-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (39 loc) · 1.3 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
# Set the base image to use to Ubuntu
FROM alpine:3.6
#Disable buffering to stdin/stdout
ENV PYTHONUNBUFFERED 1
# Set the file maintainer
MAINTAINER Carrier Access IT
# Set env variables used in this Dockerfile (add a unique prefix, such as DOCKYARD)
# Local directory with project source
ENV DOCKYARD_SRC=code/cwopp
# Directory in container for all project files
ENV DOCKYARD_SRVHOME=/srv
# Directory in container for project source files
ENV DOCKYARD_SRVPROJ=$DOCKYARD_SRVHOME/$DOCKYARD_SRC
# Update the default application repository sources list
RUN apk add --no-cache --update \
python3 \
nginx \
nano \
libpq \
py3-psycopg2 \
bash
# Create application subdirectories
WORKDIR $DOCKYARD_SRVHOME
RUN mkdir media static logs
# Copy application source code to SRCDIR
COPY $DOCKYARD_SRC $DOCKYARD_SRVPROJ
# Install Python dependencies
RUN pip3 install --no-cache-dir -r $DOCKYARD_SRVPROJ/requirements.txt
# Port to expose
EXPOSE 80
# Copy entrypoint script into the image
WORKDIR $DOCKYARD_SRVPROJ
COPY ./config.py .
COPY ./docker-entrypoint.sh /
COPY ./django_nginx.conf /etc/nginx/sites-available/
COPY ./nginx.conf /etc/nginx/
RUN mkdir -p /etc/nginx/sites-enabled/
RUN ln -s /etc/nginx/sites-available/django_nginx.conf /etc/nginx/sites-enabled/
RUN echo "daemon off;" >> /etc/nginx/nginx.conf