-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (92 loc) · 2.43 KB
/
Copy pathdocker-compose.yml
File metadata and controls
97 lines (92 loc) · 2.43 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
x-backend-env: &backend-env
APP_ENV: ${APP_ENV:-production}
APP_PORT: 8080
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://127.0.0.1:5173,http://localhost:5173}
MYSQL_DSN: ${MYSQL_DSN:-root:root@tcp(mysql:3306)/shiro_email?parseTime=true}
REDIS_ADDR: ${REDIS_ADDR:-redis:6379}
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
METRICS_TOKEN: ${METRICS_TOKEN:-}
MAIL_STORAGE_PATH: /app/data/mail
services:
mysql:
image: mysql:8.4
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_DATABASE: ${MYSQL_DATABASE:-shiro_email}
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-p${MYSQL_ROOT_PASSWORD:-root}"]
interval: 10s
timeout: 5s
retries: 10
volumes:
- mysql_data:/var/lib/mysql
deploy:
resources:
limits:
memory: 1024M
cpus: "1.0"
redis:
image: redis:7
restart: unless-stopped
command: >-
sh -c 'if [ -n "$$REDIS_PASSWORD" ]; then exec redis-server --requirepass "$$REDIS_PASSWORD"; else exec redis-server; fi'
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
healthcheck:
test:
[
"CMD-SHELL",
"if [ -n \"$${REDIS_PASSWORD}\" ]; then redis-cli -a \"$${REDIS_PASSWORD}\" ping; else redis-cli ping; fi",
]
interval: 10s
timeout: 5s
retries: 10
volumes:
- redis_data:/data
deploy:
resources:
limits:
memory: 256M
cpus: "0.5"
app:
image: ${SHIROMAIL_IMAGE:-ghcr.io/galiais/shiromail:latest}
restart: unless-stopped
environment: *backend-env
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "${FRONTEND_PORT:-5173}:80"
- "${SMTP_PORT:-25}:2525"
volumes:
- mail_data:/app/data/mail
deploy:
resources:
limits:
memory: 512M
cpus: "1.0"
worker:
image: ${SHIROMAIL_IMAGE:-ghcr.io/galiais/shiromail:latest}
command: ["shiro-worker"]
restart: unless-stopped
environment: *backend-env
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- mail_data:/app/data/mail
deploy:
resources:
limits:
memory: 512M
cpus: "0.5"
volumes:
mysql_data:
redis_data:
mail_data: