This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.non-multistage
68 lines (56 loc) · 1.78 KB
/
Dockerfile.non-multistage
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM python:3.6-alpine3.8
RUN mkdir /app/
WORKDIR /app/
ADD requirements.txt /app/requirements.txt
ADD package.json /app/package.json
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
build-base \
libffi-dev \
linux-headers \
postgresql-dev \
yarn \
libev \
libevdev \
&& apk add --no-cache --virtual .run-deps \
bash \
git \
pcre-dev \
postgresql-client \
nodejs \
nodejs-npm \
libjpeg-turbo-dev \
libpng-dev \
freetype-dev \
libxml2-dev \
libxslt-dev \
&& pip3 install -U pip \
&& LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "pip3 install --no-cache-dir -r ./requirements.txt" \
&& yarn install \
&& apk del .build-deps
# Copy your application code to the container
# (make sure you create a .dockerignore file if any large files or directories should be excluded)
ADD . /app/
WORKDIR /app/
# install npm dependencies, build static src & cleanup
RUN npm run dist \
&& rm -R /app/node_modules/ \
&& rm -R /app/static/
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
RUN DJANGO_SETTINGS_MODULE=app.settings.build python manage.py check
#RUN DJANGO_SETTINGS_MODULE=app.settings.build python manage.py collectstatic --noinput \
# && rm -R /app/app/static-src/
#RUN adduser -D app
#RUN chown -R app ./app/static-dist
#USER app
#COPY docker-entrypoint.sh /app/
# entrypoint (contains migration/static handling)
ENTRYPOINT ["/app/docker-entrypoint.sh"]
# Add any custom, static environment variables needed by Django or your settings file here:
ENV DJANGO_SETTINGS_MODULE=app.settings.base
# ASGI port
EXPOSE 8000
CMD [ "daphne", \
"--port", "8000", \
"--bind", "0.0.0.0", \
"app.asgi:application" ]