-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
93 lines (85 loc) · 2.27 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# version: '3.8'
services:
django_gunicorn:
container_name: django_gunicorn
build: .
expose:
- "8000"
ports:
- "8000:8000"
volumes:
- static_volume:/app/static
- media_volume:/app/media
environment:
- DB_HOST=${RDS_HOSTNAME}
- DB_NAME=${RDS_DB_NAME}
- DB_USER=${RDS_USERNAME}
- DB_PASSWORD=${RDS_PASSWORD}
- SKIP_MIGRATIONS=True
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
env_file:
- .env
command: /bin/bash -c "source ~/.bashrc && cd /app/src && poetry run gunicorn config.wsgi:application --bind 0.0.0.0:8000"
networks:
- app_network
daphne:
container_name: django_daphne
build: .
entrypoint: /app/entrypoint.sh
volumes:
- static_volume:/app/static
- media_volume:/app/media
- daphne_socket:/app/daphne_socket # UNIX 소켓을 위한 볼륨 추가
environment:
- DB_HOST=${RDS_HOSTNAME}
- DB_NAME=${RDS_DB_NAME}
- DB_USER=${RDS_USERNAME}
- DB_PASSWORD=${RDS_PASSWORD}
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
env_file:
- .env
command: /bin/bash -c "source ~/.bashrc && cd /app/src && poetry run daphne -u /app/daphne_socket/daphne.sock config.asgi:application"
networks:
- app_network
depends_on:
- redis
nginx:
image: nginx:latest
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./resources/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- static_volume:/app/static
- media_volume:/app/media
- ./resources/cert/fullchain.pem:/etc/letsencrypt/live/resdineconsulting.com/fullchain.pem
- ./resources/cert/privkey.pem:/etc/letsencrypt/live/resdineconsulting.com/privkey.pem
- daphne_socket:/app/daphne_socket
networks:
- app_network
depends_on:
- daphne
- django_gunicorn
redis:
image: redis:7.0
container_name: main-project-redis
command: redis-server --requirepass ${REDIS_PASSWORD}
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- app_network
networks:
app_network:
driver: bridge
volumes:
redis_data:
static_volume:
media_volume:
daphne_socket: