116 lines
2.3 KiB
YAML
116 lines
2.3 KiB
YAML
services:
|
|
mysql:
|
|
image: mysql:8.4
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ../backend/.env
|
|
environment:
|
|
TZ: Asia/Shanghai
|
|
volumes:
|
|
- mysql_data:/var/lib/mysql
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
cpus: '1.0'
|
|
reservations:
|
|
memory: 256M
|
|
cpus: '0.5'
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p\"$${MYSQL_ROOT_PASSWORD}\""]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
redis:
|
|
image: redis:7.4-alpine
|
|
restart: unless-stopped
|
|
volumes:
|
|
- redis_data:/data
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
cpus: '0.5'
|
|
reservations:
|
|
memory: 128M
|
|
cpus: '0.25'
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
minio:
|
|
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
|
|
restart: unless-stopped
|
|
command: server /data --console-address ":9001"
|
|
env_file:
|
|
- ../backend/.env
|
|
environment:
|
|
TZ: Asia/Shanghai
|
|
volumes:
|
|
- minio_data:/data
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
cpus: '0.5'
|
|
reservations:
|
|
memory: 256M
|
|
cpus: '0.25'
|
|
healthcheck:
|
|
test: ["CMD", "mc", "ready", "local"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
backend:
|
|
build:
|
|
context: ../backend
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ../backend/.env
|
|
volumes:
|
|
- ../backend/logs:/app/logs
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
cpus: '1.0'
|
|
reservations:
|
|
memory: 256M
|
|
cpus: '0.5'
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_healthy
|
|
expose:
|
|
- "8080"
|
|
|
|
frontend:
|
|
build:
|
|
context: ..
|
|
dockerfile: frontend/Dockerfile
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
cpus: '0.5'
|
|
reservations:
|
|
memory: 128M
|
|
cpus: '0.25'
|
|
depends_on:
|
|
- backend
|
|
ports:
|
|
- "7890:80"
|
|
|
|
volumes:
|
|
mysql_data:
|
|
redis_data:
|
|
minio_data:
|