services: minio: image: minio/minio:RELEASE.2025-04-22T22-12-26Z command: server /data --console-address ":9001" restart: unless-stopped environment: MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:?MINIO_ACCESS_KEY is required} MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:?MINIO_SECRET_KEY is required} ports: - "${MINIO_API_PORT:-9000}:9000" - "${MINIO_CONSOLE_PORT:-9001}:9001" volumes: - ./minio_data:/data healthcheck: test: ["CMD", "curl", "-f", "http://127.0.0.1:9000/minio/health/live"] interval: 10s timeout: 5s retries: 10 minio-init: image: minio/mc:RELEASE.2025-04-16T18-13-26Z depends_on: minio: condition: service_healthy restart: "no" entrypoint: ["/bin/sh", "-c"] command: - >- mc alias set update-store http://minio:9000 "$${MINIO_ROOT_USER}" "$${MINIO_ROOT_PASSWORD}" && mc mb --ignore-existing "update-store/$${MINIO_BUCKET}" environment: MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:?MINIO_ACCESS_KEY is required} MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:?MINIO_SECRET_KEY is required} MINIO_BUCKET: ${MINIO_BUCKET:?MINIO_BUCKET is required} api: # 离线部署包使用已经 docker load 导入的镜像,不在目标服务器重新 build。 image: ${SIMCAE_UPDATE_SERVER_IMAGE:-simcae-update-server:0.1.0} restart: unless-stopped user: "${APP_UID:-1000}:${APP_GID:-1000}" env_file: - .env environment: SERVER_HOST: 0.0.0.0 SERVER_PORT: 8000 ENV_FILE_PATH: /app/.env DB_FILE: /data/mini.db SQL_FILE: /app/tables.sql LOCAL_UPLOAD_ROOT: /data/uploads UPLOAD_SPOOL_DIR: /data/upload_spool MINIO_DATA_DIR: /minio_data CRASH_STORAGE_ROOT: /data/crash_storage MANIFEST_PRIVATE_KEY_PATH: /run/secrets/update-keys/manifest_private_key.pem MINIO_ENDPOINT: minio:9000 MINIO_PUBLIC_ENDPOINT: ${MINIO_PUBLIC_ENDPOINT:?MINIO_PUBLIC_ENDPOINT is required} MINIO_AUTO_START: "false" MINIO_SECURE: "false" ports: - "${SERVER_PORT:-8000}:8000" volumes: # runtime 保存 SQLite、上传缓存和崩溃报告等运行数据;keys 只读挂载,避免私钥被容器误改。 - ./.env:/app/.env - ./runtime:/data - ./minio_data:/minio_data:ro - ./keys:/run/secrets/update-keys:ro depends_on: minio: condition: service_healthy minio-init: condition: service_completed_successfully healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2)"] interval: 15s timeout: 3s start_period: 10s retries: 3