-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
41 lines (35 loc) · 1.04 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
FROM python:3.7-slim
# Install prerequisites
RUN apt-get update \
&& apt-get install -y \
ca-certificates \
xmlsec1 \
libxmlsec1-dev \
libxml2-dev \
libxmlsec1-openssl \
libffi6 \
build-essential \
libpq-dev \
pkg-config \
make \
gcc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# We copy just the requirements.txt first to leverage Docker cache
# (avoid rebuilding the requirements layer when application changes)
COPY ./requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# When started, the container checks for the required configuration files
# and if it can't find them, it uses the example files to make the server
# start.
#
# The example files won't be available if the user rebinds /app/conf,
# so we make a copy somewhere else.
# Copy the full application in a single layer
COPY . /app
EXPOSE 5000
VOLUME /app
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["python", "app.py"]