forked from praekeltfoundation/docker-django-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalpine.dockerfile
More file actions
38 lines (29 loc) · 1.14 KB
/
alpine.dockerfile
File metadata and controls
38 lines (29 loc) · 1.14 KB
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
FROM praekeltfoundation/python3-base:alpine
MAINTAINER Praekelt Foundation <dev@praekeltfoundation.org>
# Install libpq for PostgreSQL support and Nginx to serve everything
RUN apk --no-cache add libpq nginx
# Install gunicorn
RUN pip install gunicorn
# Copy in the Nginx config
COPY ./nginx/ /etc/nginx/
# Create gunicorn user and group, make directory for socket, and add nginx user
# to gunicorn group so that it can read/write to the socket.
RUN addgroup gunicorn \
&& adduser -S -G gunicorn gunicorn \
&& mkdir /var/run/gunicorn \
&& chown gunicorn:gunicorn /var/run/gunicorn \
&& adduser nginx gunicorn
# Create celery user and group, make directory for beat schedule file.
RUN addgroup celery \
&& adduser -S -G celery celery \
&& mkdir /var/run/celery \
&& chown celery:celery /var/run/celery
EXPOSE 8000
COPY ./django-entrypoint.sh /scripts/
CMD ["django-entrypoint.sh"]
WORKDIR /app
ONBUILD COPY . /app
# chown the app directory after copying in case the copied files include
# subdirectories that will be written to, e.g. the media directory
ONBUILD RUN chown -R gunicorn:gunicorn /app
ONBUILD RUN pip install -e .