-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.server.yml
More file actions
153 lines (147 loc) · 4.47 KB
/
Copy pathdocker-compose.server.yml
File metadata and controls
153 lines (147 loc) · 4.47 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
services:
mysql:
image: mysql:8.0
container_name: ciphergate-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
command:
- --default-authentication-plugin=mysql_native_password
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_general_ci
- --sort_buffer_size=4M
- --tmp_table_size=128M
- --max_heap_table_size=128M
- --key_buffer_size=64M
- --innodb_buffer_pool_size=512M
- --read_buffer_size=1M
- --read_rnd_buffer_size=768K
- --join_buffer_size=2M
- --thread_stack=256K
- --binlog_cache_size=128K
- --thread_cache_size=128
- --table_open_cache=384
- --max_connections=300
ports:
- "${MYSQL_PORT:-13306}:3306"
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 20
redis:
image: redis:7-alpine
container_name: ciphergate-redis
restart: unless-stopped
ports:
- "${REDIS_PORT_HOST:-16379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 20
rabbitmq:
image: rabbitmq:3.12-management-alpine
container_name: ciphergate-rabbitmq
restart: unless-stopped
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME:-rabbitmq}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-rabbitmq}
ports:
- "${RABBITMQ_PORT:-5672}:5672"
- "${RABBITMQ_MGMT_PORT:-15672}:15672"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "check_port_connectivity"]
interval: 15s
timeout: 10s
retries: 10
start_period: 30s
minio:
image: minio/minio:latest
container_name: ciphergate-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
ports:
- "${MINIO_API_PORT:-19000}:9000"
- "${MINIO_CONSOLE_PORT:-19001}:9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 20
backend:
image: eclipse-temurin:17-jre-alpine
container_name: ciphergate-backend
restart: unless-stopped
working_dir: /app
command: >
java -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
-Djava.security.egd=file:/dev/./urandom
-jar /app/app.jar
--spring.profiles.active=prod
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
minio:
condition: service_healthy
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/${MYSQL_DATABASE}?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
SPRING_DATASOURCE_USERNAME: ${MYSQL_USER}
SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_DB: 0
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USERNAME:-rabbitmq}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD:-rabbitmq}
MINIO_ENABLED: "true"
MINIO_ENDPOINT: http://minio:9000
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
MINIO_BUCKET: ${MINIO_BUCKET}
ports:
- "${BACKEND_PORT:-8080}:8080"
volumes:
- ./app/app.jar:/app/app.jar:ro
- ./logs:/app/logs
frontend:
image: nginx:alpine
container_name: ciphergate-frontend
restart: unless-stopped
depends_on:
backend:
condition: service_started
ports:
- "${FRONTEND_PORT:-5173}:80"
environment:
BACKEND_CONTAINER_PORT: 8080
command: >
/bin/sh -c "envsubst '$$BACKEND_CONTAINER_PORT' < /etc/nginx/templates/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
volumes:
- ./frontend/dist:/usr/share/nginx/html:ro
- ./frontend/nginx.conf:/etc/nginx/templates/default.conf.template:ro
- ./docs:/usr/share/nginx/docs:ro
volumes:
mysql_data:
redis_data:
rabbitmq_data:
minio_data: