-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
56 lines (53 loc) · 1.15 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:
django-backend:
build:
context: .
dockerfile: Dockerfile
restart: always
container_name: django-backend
env_file:
- .env
command:
- bash
- -c
- |
python manage.py migrate
echo yes | python manage.py collectstatic
gunicorn sns.wsgi:application --bind 0.0.0.0:8000
stdin_open: true
volumes:
- .:/var/www/sns
ports:
- "8000:8000"
depends_on:
- db
db:
image: mysql
container_name: db
env_file:
- .env
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
ports:
- 3306:3306
volumes:
- ./data/db:/var/lib/mysql
environment:
- MYSQL_TCP_PORT=${MYSQL_TCP_PORT}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
nginx:
image: nginx:1.21
container_name: nginx
restart: always
volumes:
- ./config/nginx:/etc/nginx/conf.d
- ./static:/static
ports:
- "80:80"
depends_on:
- django-backend