feat: main assembly — wire all components, gin router, graceful shutdown

This commit is contained in:
2026-06-27 13:28:27 +08:00
parent 2271a54139
commit fa7f7490f5
6 changed files with 215 additions and 14 deletions
+48
View File
@@ -0,0 +1,48 @@
version: '3.8'
services:
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: notification
MYSQL_USER: notify
MYSQL_PASSWORD: notify
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
api:
build: .
ports:
- "8080:8080"
environment:
- DB_PASSWORD=notify
- SMTP_PASSWORD=
- NOTIFY_DATABASE_HOST=mysql
- NOTIFY_REDIS_HOST=redis
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
volumes:
mysql_data: