am-freescan/deploy/windows11/compose.yaml

58 lines
1.8 KiB
YAML

name: am-freescan-standalone
services:
mysql:
image: mysql:8.4
restart: unless-stopped
ports:
- "127.0.0.1:3306:3306"
environment:
TZ: Asia/Shanghai
MYSQL_DATABASE: am-freescan
MYSQL_USER: freescan
MYSQL_PASSWORD: ${MYSQL_APP_PASSWORD:?run manage.ps1 Init first}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:?run manage.ps1 Init first}
command: ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"]
volumes:
- mysql-data:/var/lib/mysql
- ${BACKUP_ROOT:?required}:/backup
healthcheck:
test: ["CMD-SHELL", "MYSQL_PWD=$$MYSQL_PASSWORD mysql -h 127.0.0.1 -ufreescan -D am-freescan -e 'SELECT 1' >/dev/null 2>&1"]
interval: 5s
timeout: 5s
retries: 36
start_period: 30s
logging:
options: {max-size: "20m", max-file: "3"}
redis:
image: redis:7.4-alpine
restart: unless-stopped
ports:
- "127.0.0.1:6379:6379"
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:?run manage.ps1 Init first}
command: ["sh", "-c", 'exec redis-server --appendonly yes --appendfsync everysec --databases 16 --requirepass "$$REDIS_PASSWORD"']
volumes:
- redis-data:/data
healthcheck:
test: ["CMD-SHELL", 'REDISCLI_AUTH="$$REDIS_PASSWORD" redis-cli -h 127.0.0.1 ping | grep -q PONG']
interval: 5s
timeout: 3s
retries: 12
logging:
options: {max-size: "20m", max-file: "3"}
web:
image: nginx:stable-alpine
restart: unless-stopped
ports:
- "5180:80"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ${WEB_ROOT:?build frontend first}:/usr/share/nginx/html:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
logging:
options: {max-size: "20m", max-file: "3"}
volumes:
mysql-data:
redis-data: