forked from F5-Refresh/bmcho-sns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
69 lines (65 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
57
58
59
60
61
62
63
64
65
66
67
68
69
version: "3.8"
services:
app:
build:
context: ./sns
dockerfile: dockerfile
restart: always
env_file:
- ./sns/.env
command:
- bash
- -c
- |
python manage.py wait_for_db -t 120
python manage.py migrate
echo yes | python manage.py collectstatic
gunicorn --bind 0:8000 sns.wsgi:application
stdin_open: true
volumes:
- ./sns:/srv/server
expose:
- "8000"
depends_on:
- database
database:
image: mysql:8.0
restart: unless-stopped
env_file:
- ./sns/.env
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
ports:
- 3306:3306
volumes:
- ./data/db:/var/lib/mysql-filse
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_TCP_PORT=${MYSQL_TCP_PORT}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
nginx:
image: nginx:1.21
restart: always
volumes:
- ./config/nginx:/etc/nginx/conf.d
- ./sns/static:/static
ports:
- "80:80"
depends_on:
- app
redis:
container_name: redis
image: redis:alpine
restart: always
command: redis-server --port 6379
expose:
- "6379"
ports:
- 6379:6379
volumes:
- ./cache:/data
depends_on:
- app