-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
170 lines (165 loc) · 4.19 KB
/
docker-compose.yml
File metadata and controls
170 lines (165 loc) · 4.19 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
version: '3.8'
services:
# API Application (Production)
api:
build:
context: .
dockerfile: Dockerfile.api
args:
- BUILD_DATE=${BUILD_DATE}
- VCS_REF=${VCS_REF}
- VERSION=${VERSION:-latest}
image: monew-api:${VERSION:-latest}
container_name: monew-api-prod
environment:
SPRING_PROFILES_ACTIVE: prod
DB_URL: ${DB_URL}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
MongoDB_URI: ${MongoDB_URI}
AWS_S3_ACCESS_KEY: ${AWS_S3_ACCESS_KEY}
AWS_S3_SECRET_KEY: ${AWS_S3_SECRET_KEY}
AWS_S3_REGION: ${AWS_S3_REGION}
AWS_S3_BUCKET: ${AWS_S3_BUCKET}
JAVA_OPTS: "-Xmx1g -Xms512m -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0"
ports:
- "${API_PORT:-8080}:8080"
networks:
- monew-network
restart: always
healthcheck:
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/actuator/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
deploy:
resources:
limits:
cpus: '2'
memory: 1536M
reservations:
cpus: '0.5'
memory: 512M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Batch Application (Production)
batch:
build:
context: .
dockerfile: Dockerfile.batch
args:
- BUILD_DATE=${BUILD_DATE}
- VCS_REF=${VCS_REF}
- VERSION=${VERSION:-latest}
image: monew-batch:${VERSION:-latest}
container_name: monew-batch-prod
environment:
SPRING_PROFILES_ACTIVE: prod
DB_URL: ${DB_URL}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
AWS_S3_ACCESS_KEY: ${AWS_S3_ACCESS_KEY}
AWS_S3_SECRET_KEY: ${AWS_S3_SECRET_KEY}
AWS_S3_REGION: ${AWS_S3_REGION}
AWS_S3_BUCKET: ${AWS_S3_BUCKET}
NAVER_CLIENT_ID: ${NAVER_CLIENT_ID}
NAVER_CLIENT_SECRET: ${NAVER_CLIENT_SECRET}
MONEW_API_URL: ${MONEW_API_URL}
JAVA_OPTS: "-Xmx1g -Xms512m -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0"
ports:
- "${BATCH_PORT:-8081}:8081"
depends_on:
- api
networks:
- monew-network
restart: always
deploy:
resources:
limits:
cpus: '2'
memory: 1536M
reservations:
cpus: '0.5'
memory: 512M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Monitor Application (Production)
monitor:
build:
context: .
dockerfile: Dockerfile.monitor
args:
- BUILD_DATE=${BUILD_DATE}
- VCS_REF=${VCS_REF}
- VERSION=${VERSION:-latest}
image: monew-monitor:${VERSION:-latest}
container_name: monew-monitor-prod
environment:
SPRING_PROFILES_ACTIVE: prod
JAVA_OPTS: "-Xmx512m -Xms256m -XX:+UseContainerSupport -XX:MaxRAMPercentage=70.0"
ports:
- "${MONITOR_PORT:-8082}:8082"
depends_on:
- api
- batch
networks:
- monew-network
restart: always
healthcheck:
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8082/actuator/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1'
memory: 768M
reservations:
cpus: '0.25'
memory: 256M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Prometheus (Metrics Collector)
prometheus:
build:
context: .
dockerfile: Dockerfile.prom
image: monew-prometheus:-latest
container_name: monew-prometheus
ports:
- "9090:9090"
networks:
- monew-network
restart: always
# Grafana (Visualization)
grafana:
build:
context: .
dockerfile: Dockerfile.grafana
image: grafana/grafana:latest
container_name: monew-grafana
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
ports:
- "3000:3000"
depends_on:
- prometheus
networks:
- monew-network
restart: always
networks:
monew-network:
driver: bridge