forked from ruddra/docker-django
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
26 lines (22 loc) · 1.01 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
FROM python:3.7-alpine3.10
ENV PYTHONUNBUFFERED 1
ENV C_FORCE_ROOT true
RUN mkdir /src
RUN mkdir /static
WORKDIR /src
# add china mirrors
RUN echo 'http://mirrors.aliyun.com/alpine/v3.10/community/'>/etc/apk/repositories
RUN echo 'http://mirrors.aliyun.com/alpine/v3.10/main/'>>/etc/apk/repositories
# install psycopg2
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
&& pip install psycopg2 -i https://pypi.tuna.tsinghua.edu.cn/simple \
&& apk del build-deps
# for install psutil,see https://github.com/giampaolo/psutil/issues/664
#RUN apk add --update gcc libc-dev fortify-headers linux-headers && rm -rf /var/cache/apk/*
#RUN pip install psutil -i https://pypi.tuna.tsinghua.edu.cn/simple
ADD ./src /src
RUN pip install --upgrade pip
RUN pip install -r requirements.pip -i https://pypi.tuna.tsinghua.edu.cn/simple
CMD python manage.py collectstatic --no-input;python manage.py migrate; gunicorn mydjango.wsgi -b 0.0.0.0:8000 & celery worker --app=myapp.tasks