-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
108 lines (100 loc) ยท 2.91 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# ๋์ปคํ์ผ์ ๋น๋ํ ๋ ๋ฐ์
# ๋์ปค์ปดํฌ์ฆ๋ ์
ํ ๋ ๋ฐ์
version: "3"
services:
photoon_frontend:
build: ./frontend
command: ["npm", "start"]
container_name: photoon_frontend
environment:
- REACT_APP_BACKEND_URL=http://localhost:8000
ports:
- 3000:3000
networks:
- photoon
volumes:
- ./frontend:/frontend
tty: true
photoon_backend:
build:
# context : ํ์ฌ ํด๋์ backend ํด๋์ ์๋ ๋์ปคํ์ผ์ ์ฐ๊ฒ ๋ค.
context: ./backend
args:
DJANGO_ALLOWED_HOSTS: "*"
DJANGO_SECRET_KEY: "*"
DJANGO_CORS_ORIGIN_WHITELIST: "*"
container_name: photoon_backend
# command : ์ปจํ
์ด๋๊ฐ ๋์์ง ๋ ์คํํ๋ ๋ช
๋ น์ด / ์๋ฒ์คํ
command: sh -c "/wait & python ./ai_model/ai_init.py & python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
# restart : ์คํจํ๋ฉด ์ฌ์์
restart: on-failure
ports:
# ์ผ์ชฝ์ด ๋์ปค ๋ฐ๊นฅ(์ธ๋ถ์์ ์ ๊ทผํ ํฌํธ๋ฒํธ) / ์ค๋ฅธ์ชฝ์ด ๋์ปค ๋ด๋ถ(์ปจํ
์ด๋ ๋ด๋ถ)
- 8000:8000
volumes:
# ์ผ์ชฝ์ด ์ฐ๋ฆฌ ์ปดํจํฐ, ์ค๋ฅธ์ชฝ์ด ๋์ปค ์ปจํ
์ด๋
# ๋ฆฌ๋
์ค ์ปจํ
์ด๋์ ๋ฐฑ์๋ ํด๋์ ์ฐ๋ฆฌ ์ปดํจํฐ์ ๋ฐฑ์๋ ํด๋๋ฅผ ๊ณต์ ํ๊ฒ ๋ค.
# ์๋ก ๋ฐ๋ ๋ถ๋ถ ์ ์ฉ๋จ
- ./backend:/backend
# ๊ฐ์ ๋คํธ์ํฌ ์ฐ๊ฒฐ
networks:
- photoon
depends_on:
- photoon_mysql
photoon_mysql:
image: mysql
command: --lower_case_table_names=1
container_name: photoon_mysql # ์ปจํ
์ด๋ ์ด๋ฆ ์ค์
ports:
- "3306:3306"
env_file:
- ./backend/.env
# environment: # -e ์ต์
# - MYSQL_DATABASE=${MYSQL_DATABASE}
# # - MYSQL_USER=${MYSQL_USER}
# - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} # MYSQL ํจ์ค์๋ ์ค์ ์ต์
# - TZ=${TZ}
# ๊ฐ์ ๋คํธ์ํฌ ์ฐ๊ฒฐ
networks:
- photoon
photoon_rabbitmq:
hostname: photoon_host
container_name: photoon_rabbitmq
image: rabbitmq:3-management
command: rabbitmq-server
restart: unless-stopped
env_file:
- ./.env
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}
- RABBITMQ_DEFAULT_VHOST=${RABBITMQ_VHOST}
ports:
- 5672:5672 # Default Port
- 15672:15672 # For UI
volumes:
- ./backend:/backend
networks:
- photoon
depends_on:
- photoon_backend
expose:
- "15672"
photoon_celery:
container_name: photoon_celery
build:
context: ./backend
restart: unless-stopped
# env_file:
# - ./.env
depends_on:
- photoon_backend
- photoon_rabbitmq
volumes:
- ./backend:/backend
networks:
- photoon
command: "celery -A config.celery worker --loglevel=info --pool=solo"
networks:
photoon:
driver: bridge