Docker Django
Usage
$ git clone https://github.com/bartkim0426/django-docker-seul.git
# when delpoy
$ docker-compose up
# when development
$ docker-compose -f docker-compose-dev.yml up
Now you can access the application at https://localhost and the admin site at https://localhost/admin.
Settings
Have to change development.env
and development_local.env
NGINX_SERVER_NAME
: add server nameuwsgi
settings- in
webapp/config/django-uwsgi.ini
Nginx
settings: HAVE TO set up before build image - In
services/webserver/config/nginx.tmpl
Processes (deploying)
1. Build and run db
- Using
postgres:9.6
image - Create volumes at
psql-data
in project dir. (Usingdevelopment.env
)
2. Build and run webapp
- using
webapp/Dockerfile
to build. - Add
webapp/config/requirements.txt
,webapp/config/start.sh/
,webapp/starter
to projectandpip install
- Run
adduser
andchown
commands - Run
webapp/config/start.sh
: migrate => collectstatic => starting uWSGI
3. Build and run webserver
- Using
services/webserver/Dockerfile
to build - Add
start.sh
,nginx.tmpl
- Run
start.sh
=> Starting Nginx
Following To-do list
chmod 755
tomedia
directory inwebapp
,webserver
postgres
database volumes checking- Not deploy at once
'backend > docker' 카테고리의 다른 글
ubuntu 16.04에 docker-compose 설치하기 (0) | 2018.02.07 |
---|---|
ubuntu 16.04에 docker-ce (Community Edition) 설치하기 (0) | 2018.02.02 |
Making django dev server with docker (0) | 2018.01.08 |
docker swarm을 사용하여 3개의 node 만들어보기 (swarm example) (0) | 2017.12.26 |
docker-machine 소개, 설치 및 기본 사용법 (0) | 2017.12.23 |