- 构建 x86 (linux/amd64) backend 和 frontend 镜像 - 导出 arm64 和 x86 两种架构的 tar.gz 镜像包 - 添加 docker-compose.x86.yml 和 docker-compose.arm64.yml - install.sh 自动检测架构并加载对应镜像 - 部署包约 200MB (backend 75M x2 + frontend 24M x2 + postgres 106M)
38 lines
785 B
YAML
38 lines
785 B
YAML
services:
|
|
db:
|
|
image: postgres:15-alpine
|
|
environment:
|
|
POSTGRES_DB: debt_manager
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
ports:
|
|
- "54326:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
backend:
|
|
image: debt-manager-backend:x86
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://postgres:postgres@db:5432/debt_manager
|
|
SECRET_KEY: change-this-in-production-please
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
frontend:
|
|
image: debt-manager-frontend:x86
|
|
ports:
|
|
- "806:80"
|
|
depends_on:
|
|
- backend
|
|
|
|
volumes:
|
|
pgdata:
|