forked from awesto/django-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (40 loc) · 1.83 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# uWSGI serving a django-shop application
# This Dockerfile builds the base image for all merchant implementations using **django-SHOP**:
# docker build -t awesto/uwsgi-django-shop .
FROM awesto/fedora-uwsgi-python:5
LABEL Description="Official django-SHOP image" Maintainer="Jacob Rief <[email protected]>"
RUN dnf upgrade -y
RUN dnf install -y redis java
RUN rpm -i https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.5.noarch.rpm
RUN alternatives --install /usr/bin/python python /usr/bin/python3.5 2
RUN alternatives --install /usr/bin/python python /usr/bin/python2.7 1
RUN pip install --upgrade pip
COPY docker-files/uwsgi.ini /etc/uwsgi.ini
RUN chown uwsgi.uwsgi /run/uwsgi
COPY docker-files/elasticsearch.ini /etc/uwsgi.d/elasticsearch.ini
RUN chown elasticsearch.elasticsearch /etc/uwsgi.d/elasticsearch.ini
COPY docker-files/redis.ini /etc/uwsgi.d/redis.ini
COPY docker-files/redis.conf /etc/redis.conf
RUN chown redis.redis /etc/uwsgi.d/redis.ini
RUN cat /etc/resolv.conf
RUN pip install uwsgi
ADD requirements /tmp/requirements
RUN pip install Django==1.10.7
RUN pip install -r /tmp/requirements/common.txt
# copy the local django-shop file into a temporary folder
RUN mkdir -p /tmp/django-shop
COPY LICENSE.txt /tmp/django-shop
COPY README.md /tmp/django-shop
COPY MANIFEST.in /tmp/django-shop
COPY setup.py /tmp/django-shop
ADD email_auth /tmp/django-shop/email_auth
ADD shop /tmp/django-shop/shop
# and from there install it into the site-package using setup.py
RUN pip install /tmp/django-shop
RUN rm -rf /tmp/django-shop
RUN mkdir -p /web/{logs,workdir,elasticsearch,redis}
RUN mkdir -p /web/logs/elasticsearch
RUN useradd -M -d /web -s /bin/bash django
RUN chown -R django.django /web/{logs,workdir}
RUN chown -R elasticsearch.elasticsearch /web/elasticsearch /web/logs/elasticsearch
RUN chown -R redis.redis /web/redis