-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
39 lines (31 loc) · 1.21 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
FROM python:3.6-alpine
# File Author / Maintainer
MAINTAINER badarg <spiperac@denkei.org>
ENV PYTHONUNBUFFERED 1
RUN mkdir /app
WORKDIR /app
ADD . /app/
RUN chmod +x /app/docker-entrypoint.sh
RUN apk add --no-cache --virtual .build-deps \
ca-certificates gcc linux-headers musl-dev \
libffi-dev jpeg-dev zlib-dev libjpeg-turbo-dev jpeg mariadb-dev \
&& pip install -r requirements.txt \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .rundeps $runDeps libjpeg-turbo-dev jpeg-dev jpeg mysql-client \
&& apk del .build-deps
ENV DJANGO_SETTINGS_MODULE bctf.settings.production
RUN python manage.py collectstatic --noinput
RUN rm -rf ./static/
EXPOSE 31337
# CMD ["/usr/local/bin/gunicorn", "--chdir", "/app/", "--workers=4", "bctf.wsgi", "-b", "0.0.0.0:8000"]
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]