This repository has been archived on 2026-11-17. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
storage/docker-compose.yml
Sergei Poljanski 46b18ee2ae
All checks were successful
Deploy storage stack / deploy (push) Successful in 25s
Postgres 18.7
Move the shared Postgres from 17 to 18.7 by dump and restore into a new
volume, pg_data_18, mounted at /var/lib/postgresql as the 18 image
requires (PGDATA moved to /var/lib/postgresql/18/docker). The 17 data
volume stays as it was.

Procedure (2026-11-13): restic snapshot and pg_dumpall to S3; stop
asxpio, asxpio-monitor and datacenterbingo; final pg_dumpall; deploy
this; restore the dump; compare per-table row counts; start the apps.

Rollback: revert this commit and redeploy (17.12 on the untouched
pg_data), then start the apps. Writes made on 18 in between would need
a pg_dump from 18 to carry over.

Assisted-by: Claude:opus-5-5
2026-11-13 04:21:38 +04:00

95 lines
3.3 KiB
YAML

services:
postgres:
image: postgres:18.7-alpine
container_name: storage-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: postgres
volumes:
# Postgres 18's image keeps PGDATA in /var/lib/postgresql/18/docker
# and refuses the old /var/lib/postgresql/data mount
- pg_data_18:/var/lib/postgresql
networks:
- storage
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
postgres-init:
image: postgres:18.7-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"
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=true"
- "traefik.docker.network=traefik"
# The S3 API.
- "traefik.http.routers.garage-s3.rule=Host(`s3.asxp.io`)"
- "traefik.http.routers.garage-s3.entrypoints=websecure"
- "traefik.http.routers.garage-s3.tls=true"
- "traefik.http.routers.garage-s3.tls.certresolver=letsencrypt"
- "traefik.http.routers.garage-s3.service=garage-s3"
- "traefik.http.services.garage-s3.loadbalancer.server.port=3900"
# Anonymous reads of the public bucket: unsigned GET/HEAD of
# /public/<key> goes to the web endpoint as Host public.web.garage,
# path /<key>. Signed requests still reach the S3 API above.
- "traefik.http.routers.garage-public.rule=Host(`s3.asxp.io`) && PathPrefix(`/public/`) && (Method(`GET`) || Method(`HEAD`)) && !HeaderRegexp(`Authorization`, `.+`) && !QueryRegexp(`X-Amz-Signature`, `.+`)"
- "traefik.http.routers.garage-public.priority=1000"
- "traefik.http.routers.garage-public.entrypoints=websecure"
- "traefik.http.routers.garage-public.tls=true"
- "traefik.http.routers.garage-public.tls.certresolver=letsencrypt"
- "traefik.http.routers.garage-public.service=garage-web"
- "traefik.http.routers.garage-public.middlewares=garage-public-strip,garage-public-host"
- "traefik.http.middlewares.garage-public-strip.stripprefix.prefixes=/public"
- "traefik.http.middlewares.garage-public-host.headers.customrequestheaders.Host=public.web.garage"
- "traefik.http.services.garage-web.loadbalancer.server.port=3902"
volumes:
# Postgres 17's data, left untouched by the move to 18: the rollback.
# Remove once 18 has run well.
pg_data:
pg_data_18:
garage_meta:
garage_data:
networks:
storage:
name: storage
traefik:
external: true