-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
88 lines (77 loc) · 1.88 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
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
#restart: on-failure
# redis:
# image: redis:alpine
# ports:
# - "6379:6379"
nginx:
image: nginx:latest
container_name: nginx_service
ports:
- "8080:8080"
depends_on:
- backend
- frontend
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
volumes:
mongoVolume: