-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
38 lines (29 loc) · 937 Bytes
/
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
FROM nikolaik/python-nodejs:python3.9-nodejs21
ENV POETRY_VIRTUALENVS_CREATE false \
PIP_NO_CACHE_DIR off \
PIP_DISABLE_PIP_VERSION_CHECK on \
PYTHONUNBUFFERED 1 \
NODE_ENV production
ADD packages.txt /packages.txt
RUN set -ex; \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -; \
apt-get update; \
cat /packages.txt | grep -v \# | xargs apt-get install -y; \
# cleaning up unused files \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
ADD requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
ARG USER_ID=1001
ARG GROUP_ID=1001
RUN set -ex; \
addgroup --gid $GROUP_ID --system django; \
adduser --system --home /home/django --uid $USER_ID --gid $GROUP_ID django
USER django
COPY --chown=django:django . /app
WORKDIR /app
RUN set -ex; \
yarn; \
yarn build;
EXPOSE 5000
CMD /app/bin/start-web.sh