-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·45 lines (35 loc) · 1.02 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
### Build and install packages
FROM python:3.7 as build-python
RUN \
apt-get -y update && \
apt-get install -y gettext && \
# Cleanup apt cache
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Python dependencies
RUN pip install pipenv
ADD Pipfile /app/
ADD Pipfile.lock /app/
WORKDIR /app
RUN pipenv install --system --deploy --dev
### Final image
FROM python:3.7-slim
RUN \
apt-get update && \
apt-get install -y libxml2 libssl1.1 libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 shared-mime-info mime-support && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ADD . /app
COPY --from=build-python /usr/local/lib/python3.7/site-packages/ /usr/local/lib/python3.7/site-packages/
COPY --from=build-python /usr/local/bin/ /usr/local/bin/
WORKDIR /app
RUN SECRET_KEY=dummy
RUN useradd --system engine && \
mkdir -p /app/media /app/static && \
chown -R engine:engine /app/
USER engine
EXPOSE 9999
ENV PORT 9999
ENV PYTHONUNBUFFERED 1
ENV PROCESSES 4
CMD ["uwsgi", "/app/engine/wsgi/uwsgi.ini"]