-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.local
More file actions
33 lines (25 loc) · 1.2 KB
/
Dockerfile.local
File metadata and controls
33 lines (25 loc) · 1.2 KB
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
FROM python:3.6.4-slim
MAINTAINER team.overeats@gmail.com
# apt-get으로 nginx supervisor 설치
RUN apt-get -y update
RUN apt-get -y dist-upgrade
RUN apt-get -y install build-essential nginx supervisor
# requirments만 복사
COPY .requirements /srv/.requirements
# pip install
WORKDIR /srv
RUN pip install -r /srv/.requirements/dev.txt
# 소스폴더를 통째로 복사
COPY . /srv/project
# nginx 설정파일을 복사 및 링크
RUN cp -f /srv/project/.config/local/nginx.conf /etc/nginx/nginx.conf &&\
cp -f /srv/project/.config/local/nginx-app.conf /etc/nginx/sites-available/ &&\
rm -f /etc/nginx/sites-enabled/* &&\
ln -sf /etc/nginx/sites-available/nginx-app.conf /etc/nginx/sites-enabled/
# supervisor 설정파일을 복사
RUN cp /srv/project/.config/local/supervisord.conf /etc/supervisor/conf.d/
# sqlite DB migrate, creatsuperuser
WORKDIR /srv/project/app
RUN python manage.py migrate && python manage.py createsu
# pkill nginx 후 supervisord 실행
CMD pkill nginx; supervisord -n