70 lines
1.7 KiB
YAML
70 lines
1.7 KiB
YAML
services:
|
|
backend:
|
|
image: ${REGISTRY}/${NAMESPACE}/email-unlimit-server:${IMAGE_TAG}
|
|
container_name: email-unlimit-backend
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ./backend/.env
|
|
ports:
|
|
- "127.0.0.1:3000:3000"
|
|
- "25:25"
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-fsS", "http://localhost:3000/health"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 20s
|
|
networks:
|
|
- email-unlimit
|
|
|
|
mysql:
|
|
image: mysql:8.0
|
|
container_name: email-unlimit-mysql
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
|
MYSQL_USER: ${MYSQL_USER}
|
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
TZ: Asia/Shanghai
|
|
volumes:
|
|
- mysql-data:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "mysqladmin ping -h localhost -p$$MYSQL_ROOT_PASSWORD --silent"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 30s
|
|
networks:
|
|
- email-unlimit
|
|
|
|
redis:
|
|
image: redis:7.4-alpine
|
|
container_name: email-unlimit-redis
|
|
restart: unless-stopped
|
|
environment:
|
|
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
|
command: ["sh", "-c", "redis-server --appendonly yes --requirepass $$REDIS_PASSWORD"]
|
|
volumes:
|
|
- redis-data:/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "redis-cli -a \"$$REDIS_PASSWORD\" ping | grep -q PONG"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 10
|
|
networks:
|
|
- email-unlimit
|
|
|
|
networks:
|
|
email-unlimit:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
mysql-data: {}
|
|
redis-data: {}
|