-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
152 lines (139 loc) · 4.19 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
version: "3"
services:
db:
container_name: mysql_con
image: mysql:8.0
# volumes:
# - ./volume/mysql/data:/var/lib/mysql
# expose:
# - 3306
# networks:
# - backend-net
environment: # 컨테이너 안의 환경변수 설정
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_USER_PASSWORD}
- TZ=Asia/Seoul
ports:
- "3307:3306" # 배포 후 외부 포트 막고 expose로 설정
tty: true
backend:
container_name: backend_con
build:
context: ./backend
restart: on-failure
ports:
- "8080:8080"
# expose:
# - 8080
depends_on:
- db
- rabbitmq
# networks:
# - backend-net
tty: true #명령어 실행 끝나도 꺼지지 않음
rabbitmq:
image: rabbitmq:3.9-management-alpine # 웹 UI management 툴 포함
command: >
bash -c "rabbitmq-plugins enable rabbitmq_web_stomp
&& rabbitmq-plugins enable rabbitmq_web_stomp_examples
&& rabbitmq-server"
ports:
- "5672:5672"
- "15672:15672" # GUI management
# healthcheck:
# test: [ "CMD", "nc", "-z", "localhost", "5672" ]
# interval: 10s
# timeout: 10s
# retries: 5
# expose:
# - 5672
# - 15672
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASSWORD}
volumes:
- ./rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
# neitworks:
# - backend-net
# frontend:
# container_name: frontend_con
# build:
# context: ./frontend
# dockerfile: Dockerfile
# command: ["npm", "start"]
# ports:
# - "3001:3001"
# expose:
# - 3000
# # networks:
# # - frontend-net
nginx:
container_name: nginx_con
restart: on-failure
build:
dockerfile: Dockerfile
context: ./frontend
ports:
- "80:80"
- "443:443"
- "8081:8081"
expose:
- "61613"
volumes:
- ./frontend:/client
- ./data/nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
depends_on:
- backend
certbot:
container_name: certbot-con
image: certbot/certbot:latest
# command: certonly --webroot --webroot-path=/var/www/certbot --email [email protected] --agree-tos --no-eff-email -d www.rising-aha.net
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
# networks:
# - backend-net
# - frontend-net
# prometheus:
# image: prom/prometheus #docker Hub에서 가져와서 사용
# container_name: prom_con #컨테이너 이름 설정
# volumes:
# - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
# # - ./prometheus/volume:/prometheus
# ports:
# - 9090:9090 #외부:내부포트
# command: # 컨테이너 실행 완료 후 컨테이너의 쉘에서 실행시킬 쉘명령어를 지정할 수 있다.
# - '--web.enable-lifecycle' #구성된 규칙 파일 다시 로드
# - '--config.file=/etc/prometheus/prometheus.yml' #로드할 구성 파일 지정
# # restart: always #컨테이너가 다운될 경우 항상 재실행
# depends_on:
# - node-exporter
# node-exporter:
# image: nginx/nginx-prometheus-exporter
# container_name: node-exporter
# ports:
# - 9113:9113
# command:
# - -nginx.scrape-uri=http://nginx:80/metrics
# depends_on:
# - nginx
# restart: on-failure
# grafana:
# container_name: grafana
# image: grafana/grafana:latest
# ports:
# - 3000:3000
# volumes:
# - ./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml
# environment:
# - GF_AUTH_ANONYMOUS_ENABLED=true
# - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
#networks:
# backend-net: # 이후 backend-net은 모두 expose로 변경
# driver: bridge
# frontend-net:
# driver: bridge