storage/docker-compose.yml
Sergei Poljanski dc04ff3cce
All checks were successful
Deploy storage stack / deploy (push) Successful in 25s
Add Garage beside MinIO
MinIO is abandoned upstream and its images are gone from the registries,
so the object store cannot be rebuilt or updated. Garage takes its
place.

This is the first step: Garage runs as one node next to MinIO, with the
same three buckets and one key per app, and is not routed yet. MinIO
keeps serving s3.asxp.io and is no longer bootstrapped, so its users
stay as they are until the data is copied and the apps are switched.

Garage only accepts keys in its own format. The bootstrap hashes the
existing secrets into that format, as the apps' deploys will, so no
secret has to change for the move; a secret already in Garage's format
is used as it is.

Garage has no anonymous S3 access. The public bucket is marked as a
website instead, to be served through Garage's web endpoint.

Assisted-by: Claude:fable-5-2
2026-11-11 03:41:03 +04:00

102 lines
2.7 KiB
YAML

services:
postgres:
image: postgres:17-alpine
container_name: storage-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: postgres
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- storage
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
postgres-init:
image: postgres:17-alpine
container_name: storage-postgres-init
depends_on:
postgres:
condition: service_healthy
environment:
PGHOST: postgres
PGUSER: postgres
PGPASSWORD: ${POSTGRES_PASSWORD}
ASXPIO_DB_PASSWORD: ${ASXPIO_DB_PASSWORD}
BINGO_DB_PASSWORD: ${BINGO_DB_PASSWORD}
volumes:
- ./init/postgres-init.sh:/init.sh:ro
entrypoint: ["/bin/sh", "/init.sh"]
networks:
- storage
restart: "no"
minio:
image: minio/minio:latest
container_name: storage-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
MINIO_BROWSER_REDIRECT_URL: https://s3.asxp.io
volumes:
- minio_data:/data
networks:
- storage
- traefik
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 10
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.minio-s3.rule=Host(`s3.asxp.io`)"
- "traefik.http.routers.minio-s3.entrypoints=websecure"
- "traefik.http.routers.minio-s3.tls=true"
- "traefik.http.routers.minio-s3.tls.certresolver=letsencrypt"
- "traefik.http.routers.minio-s3.service=minio-s3"
- "traefik.http.services.minio-s3.loadbalancer.server.port=9000"
# Replaces MinIO (abandoned upstream; its images are gone from the
# registries). Not routed yet: MinIO still answers s3.asxp.io until the data
# is copied and the apps are switched.
garage:
image: dxflrs/garage:v2.5.0
container_name: storage-garage
restart: unless-stopped
command: ["/garage", "server", "--single-node"]
volumes:
- ./garage.toml:/etc/garage.toml:ro
- ./secrets/garage_rpc_secret:/run/secrets/garage_rpc_secret:ro
- garage_meta:/var/lib/garage/meta
- garage_data:/var/lib/garage/data
networks:
- storage
- traefik
healthcheck:
test: ["CMD", "/garage", "status"]
interval: 10s
timeout: 5s
retries: 10
labels:
- "traefik.enable=false"
volumes:
pg_data:
minio_data:
garage_meta:
garage_data:
networks:
storage:
name: storage
traefik:
external: true