forked from sung1san3/Lego2me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
85 lines (72 loc) · 1.79 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
version: "3"
services:
db:
image: mongo:latest
restart: unless-stopped #컨테이너 스탑하기전까지 항상 재시작
volumes:
- mongoVolume:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: legolego
MONGO_INITDB_DATABASE: django_mongodb_docker
MONGODB_DATA_DIR: /var/lib/docker/volumes/mongo
ports:
- 27017:27017
backend:
container_name: lego2me_django
image: django
build:
context: ./backend
command: python manage.py runserver 0.0.0.0:8000
ports:
- 8000:8000
volumes:
- ./backend/:/backend/
expose:
- 8001
depends_on:
- db
- rabbitmq
# - redis
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- 3000:3000
volumes:
- ./frontend:/usr/src/app
- /usr/src/app/node_modules
- /usr/src/app/.next
rabbitmq:
hostname: rabbitmq
image: rabbitmq:3.7.14-management-alpine # 웹 UI management 툴 포함
# 환경변수 설정
environment:
- RABBITMQ_USER=guest
- RABBITMQ_PASSWORD=guest
#- RABBITMQ_HOSTS=rabbitmq:5672
ports:
- "5672:5672" # rabbitMQ default port
- "15672:15672" # UI를 위한 port
#restart: on-failure #정상적으로 종료되지않은 경우에만 재시작 (오류코드 0 아니면 재시작)
celery:
image: django
working_dir: /backend/
command: celery -A lego2me worker -l info
volumes:
- ./backend/:/backend/
depends_on:
- backend
nginx:
image: nginx:latest
container_name: nginx_service
ports:
- "80:80"
depends_on:
- backend
- frontend
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
volumes:
mongoVolume: