-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
130 lines (122 loc) · 2.91 KB
/
docker-compose.prod.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
version: "3"
services:
frontend:
build:
context: ./frontend
dockerfile: dockerfile.prod
# command: ["yarn", "start"]
container_name: frontend
# ports:
# - 3000:3000
volumes:
- ./frontend:/frontend
- build_folder:/frontend/build
- ./frontend/node_modules/:/frontend/node_modules
# environment:
# - CI=true
# - CHOKIDAR_USEPOLLING=true # HMR을 위해 필요한 설정
# - REACT_APP_BACKEND_URL=http://localhost:8000
stdin_open: true # react-script 3.4.1 부터 필요
tty: true
env_file:
- ./frontend/.env.local
# 가상 네트워크 연결
# networks:
# - gd
backend:
container_name: backend
build:
context: ./backend
args:
DJANGO_ALLOWED_HOSTS: "*"
DJANGO_SECRET_KEY: "*"
DJANGO_CORS_ORIGIN_WHITELIST: "*"
command: >
bash -c "python3 manage.py makemigrations gdiary &&
python3 manage.py makemigrations text &&
python3 manage.py migrate gdiary &&
python3 manage.py migrate text &&
gunicorn config.wsgi --bind 0.0.0.0:8000"
# decode.py, makemigrations, migrate 따로 해야함
restart: on-failure
ports:
- 8000:8000
volumes:
- ./backend:/backend
- static_volume:/backend/staticfiles
- media_volume:/backend/mediafiles
# depends_on:
# - rabbitmq
expose:
- 8000
env_file:
- ./backend/.env
# 가상 네트워크 연결
# networks:
# - gd
# mysql:
# image: mysql
# command: --lower_case_table_names=1
# container_name: mysql # 컨테이너 이름 설정
# ports:
# - "3307:3306"
# env_file:
# - ./backend/.env
# networks:
# - gd
rabbitmq:
hostname: localhost
container_name: rabbitmq
image: rabbitmq:3-management
command: rabbitmq-server
restart: unless-stopped
environment:
- RABBITMQ_USER=guest
- RABBITMQ_PASSWORD=guest
ports:
- 5672:5672 # Default Port
- 15672:15672 # For UI
volumes:
- ./backend:/backend
# networks:
# - gd
depends_on:
- backend
expose:
- "15672"
celery:
container_name: celery
build:
context: ./backend
restart: unless-stopped
depends_on:
- backend
- rabbitmq
volumes:
- ./backend:/backend
# networks:
# - gd
command: "celery -A config.celery worker --loglevel=info --pool=solo"
nginx:
build: ./nginx
container_name: nginx
ports:
- 80:8080
restart: always
volumes:
- static_volume:/backend/staticfiles
- media_volume:/backend/mediafiles
- build_folder:/var/www/frontend
depends_on:
- backend
- frontend
# # 가상 네트워크 연결
# networks:
# - gd
# networks:
# gd:
# driver: bridge
volumes:
static_volume: null
media_volume: null
build_folder: null