head-vps/rustfs/compose.yaml

48 lines
1.2 KiB
YAML

# RustFS: the S3 of every app on the VPS. API at https://${S3_DOMAIN} (credentials required, except
# the public prefixes), media read-only at https://${ASSETS_DOMAIN}/<bucket>/<key>.
services:
server:
image: rustfs-head:1.0.4
build: .
user: "0:0"
secrets:
- age_key
restart: unless-stopped
entrypoint: ["/head/start.sh"]
environment:
RUSTFS_VOLUMES: /data
RUSTFS_ADDRESS: 0.0.0.0:9000
RUSTFS_CONSOLE_ENABLE: "false"
volumes:
- data:/data
networks:
- default
- caddy
labels:
caddy_0: ${S3_DOMAIN}
caddy_0.reverse_proxy: "{{upstreams 9000}}"
caddy_1: ${ASSETS_DOMAIN}
caddy_1.@write.not.method: GET HEAD
caddy_1.respond: "@write 405"
caddy_1.reverse_proxy: "{{upstreams 9000}}"
# Buckets, public prefixes and app users, declared in buckets.conf (init.sh), on every start.
post_start:
- command: ["/head/init.sh"]
user: root
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:9000/health"]
interval: 15s
timeout: 5s
start_period: 20s
retries: 5
secrets:
age_key:
file: /etc/head-vps/age.key
networks:
caddy:
external: true
volumes:
data: