docker-compose 模板
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.1 KiB

version: '3'
services:
mysql:
image: mysql:5.7
volumes:
- ./mysql:/var/lib/mysql
expose:
- "3306"
restart: always
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=djangodocker
- MYSQL_USER=django
- MYSQL_PASSWORD=django
nginx:
image: nginx:alpine
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/conf:/etc/nginx/conf.d
- ./web/staticfiles:/django_static
ports:
- "80:80"
depends_on:
- web
redis:
image: redis:alpine
expose:
- "6379"
restart: always
web:
build: .
# command: python manage.py runserver 0:8000
# ports:
# - "8000:8000"
command: uwsgi --ini uwsgi.ini
working_dir: /code/web
volumes:
- .:/code
expose:
- "8000"
depends_on:
- mysql
- redis
celery:
build: .
command: celery -A web worker -l info
working_dir: /code/web
volumes:
- .:/code
depends_on:
- mysql
- redis