| 1 | services: |
| 2 | app: |
| 3 | build: |
| 4 | context: . |
| 5 | dockerfile: Dockerfile |
| 6 | args: |
| 7 | NEXT_PUBLIC_BASE_URL: ${NEXT_PUBLIC_BASE_URL:-http://localhost:3000} |
| 8 | ports: |
| 9 | - "3000:3000" |
| 10 | env_file: |
| 11 | - .env |
| 12 | environment: |
| 13 | DATABASE_URL: postgresql://saturn:saturn@postgres:5432/saturn |
| 14 | S3_ENDPOINT: http://rustfs:9000 |
| 15 | S3_REGION: us-east-1 |
| 16 | S3_ACCESS_KEY_ID: minioadmin |
| 17 | S3_SECRET_ACCESS_KEY: minioadmin |
| 18 | S3_BUCKET: saturn |
| 19 | depends_on: |
| 20 | migrate: |
| 21 | condition: service_completed_successfully |
| 22 | rustfs: |
| 23 | condition: service_healthy |
| 24 | restart: unless-stopped |
| 25 | |
| 26 | migrate: |
| 27 | build: |
| 28 | context: . |
| 29 | dockerfile: Dockerfile |
| 30 | args: |
| 31 | NEXT_PUBLIC_BASE_URL: ${NEXT_PUBLIC_BASE_URL:-http://localhost:3000} |
| 32 | command: ["node", |
| 33 | environment: |
| 34 | DATABASE_URL: postgresql://saturn:saturn@postgres:5432/saturn |
| 35 | depends_on: |
| 36 | postgres: |
| 37 | condition: service_healthy |
| 38 | restart: "no" |
| 39 | |
| 40 | postgres: |
| 41 | image: postgres:17-alpine |
| 42 | environment: |
| 43 | POSTGRES_USER: saturn |
| 44 | POSTGRES_PASSWORD: saturn |
| 45 | POSTGRES_DB: saturn |
| 46 | ports: |
| 47 | - "5432:5432" |
| 48 | volumes: |
| 49 | - postgres_data:/var/lib/postgresql/data |
| 50 | healthcheck: |
| 51 | test: ["CMD-SHELL", |
| 52 | interval: 5s |
| 53 | timeout: 5s |
| 54 | retries: 5 |
| 55 | restart: unless-stopped |
| 56 | |
| 57 | rustfs: |
| 58 | image: rustfs/rustfs:latest |
| 59 | command: server /data --console-address ":9001" |
| 60 | environment: |
| 61 | RUSTFS_ROOT_USER: minioadmin |
| 62 | RUSTFS_ROOT_PASSWORD: minioadmin |
| 63 | ports: |
| 64 | - "9000:9000" |
| 65 | - "9001:9001" |
| 66 | volumes: |
| 67 | - rustfs_data:/data |
| 68 | healthcheck: |
| 69 | test: ["CMD", |
| 70 | interval: 5s |
| 71 | timeout: 5s |
| 72 | retries: 5 |
| 73 | start_period: 5s |
| 74 | restart: unless-stopped |
| 75 | |
| 76 | createbucket: |
| 77 | image: rustfs/rustfs:latest |
| 78 | depends_on: |
| 79 | rustfs: |
| 80 | condition: service_healthy |
| 81 | entrypoint: /bin/sh |
| 82 | command: > |
| 83 | -c " |
| 84 | mc alias set local http://rustfs:9000 minioadmin minioadmin && |
| 85 | mc mb --ignore-existing local/saturn |
| 86 | " |
| 87 | |
| 88 | volumes: |
| 89 | postgres_data: |
| 90 | rustfs_data: |