-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
56 lines (55 loc) · 1.39 KB
/
docker-compose.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
version: '3'
services:
db:
image: mysql
container_name: mysql
volumes:
- ./data/db:/var/lib/mysql
security_opt:
- seccomp:unconfine
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
- MYSQL_ROOT_PASSWORD=mysql
- MYSQL_PORT=3306
- MYSQL_DATABASE=mysql
- MYSQL_USER=mysql
- MYSQL_PASSWORD=mysql
- LANG=C.UTF-8
django:
build: .
container_name: django
volumes:
- .:/code
command: sh -c "/code/tools/wait-for.sh db:3306 -- /code/tools/start-django.sh ${COMPOSE_PROFILES}"
#command: sh -c "/code/tools/start-django.sh ${COMPOSE_PROFILES}"
restart: always
ports:
- "${DJANGO_PORT}:${DJANGO_PORT}"
environment:
- MYSQL_NAME=mysql
- MYSQL_USER=mysql
- MYSQL_PASSWORD=mysql
- MYSQL_HOST=db
- TZ=Asia/Shanghai
- DJANGO_PORT=${DJANGO_PORT}
- DJANGO_PROJECT_NAME=${DJANGO_PROJECT_NAME}
depends_on:
- db
nginx:
image: nginx
container_name: nginx
volumes:
- .:/code
- ./conf/templates:/etc/nginx/templates
- ./conf/conf.d:/etc/nginx/conf.d
profiles:
- release
restart: always
ports:
- "${NGINX_PORT}:${NGINX_PORT}"
environment:
- NGINX_PORT=${NGINX_PORT}
- NGINX_SERVER_NAME=${NGINX_SERVER_NAME}
depends_on:
- django