fuckingtech/deploy/compose.yaml

56 lines
1.6 KiB
YAML

# fuckingtech.ch on the HEAD VPS, deployed by doco-cd (head-vps) on every push to main.
# The database is the SQLite object in RustFS on this host (kysely-sqlite-blob), so the container holds no state.
x-app: &app
image: fuckingtech:main
pull_policy: never
secrets:
- age_key
environment:
# Not secret. The production database is the timeline of the main branch.
DENO_TIMELINE: git-branch/main
NODE_ENV: production
LOG_EMAIL_FROM: bureaudouble-noreply@mecanic-email.elias.systems
LOG_EMAIL_TO: elias.rhouzlane@gmail.com
S3_BUCKET_REGION: us-east-1
S3_DEFAULT_BUCKET: fuckingtech
S3_ENDPOINT_URL: s3.fuckingtech.ch
S3_PUBLIC_URL: https://assets.fuckingtech.ch/fuckingtech/
services:
# The migration MF's predeploy ran: once per deployment, before the server.
migrate:
<<: *app
command: ["./server", "db", "apply"]
restart: on-failure
web:
<<: *app
build:
context: ..
dockerfile: deploy/Dockerfile
secrets:
- age_key
restart: unless-stopped
depends_on:
migrate:
condition: service_completed_successfully
networks:
- caddy
labels:
caddy: ${FT_DOMAIN}
caddy.reverse_proxy: "{{upstreams 8000}}"
healthcheck:
test: ["CMD", "deno", "eval", "const r = await fetch('http://127.0.0.1:8000/'); if (r.status >= 500) Deno.exit(1)"]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
secrets:
age_key:
# Created by head-vps/bootstrap.sh; its public half is a recipient in ../fnox.toml.
file: /etc/head-vps/age.key
networks:
caddy:
external: true