63 lines
2.0 KiB
YAML
63 lines
2.0 KiB
YAML
# The project name is fixed (not taken from the directory), so volume and network
|
|
# names stay stable: halcyon_data, halcyon_manual, halcyon_caddy-data, ...
|
|
name: halcyon
|
|
|
|
services:
|
|
web:
|
|
build: .
|
|
image: halcyon:latest
|
|
# A fixed name lets scripts/daily.sh find the container with `docker exec`.
|
|
container_name: halcyon
|
|
restart: unless-stopped
|
|
ports:
|
|
# Local only: the public entrance is Caddy, which terminates TLS.
|
|
- "127.0.0.1:8070:8080"
|
|
environment:
|
|
DATABASE_URL: sqlite:/data/halcyon.db
|
|
# The world. `docker exec ... daily` inherits these, so the daily job always
|
|
# matches the server. A world refuses changed settings once it has run, so
|
|
# only change them on a fresh volume. Defaults shown; override in .env.
|
|
HALCYON_SEED: ${HALCYON_SEED:-1}
|
|
HALCYON_TICKS_PER_DAY: ${HALCYON_TICKS_PER_DAY:-1440}
|
|
HALCYON_CYCLES_PER_TICK: ${HALCYON_CYCLES_PER_TICK:-2000}
|
|
HALCYON_PROGRAM_BYTES: ${HALCYON_PROGRAM_BYTES:-4096}
|
|
HALCYON_RAM_BYTES: ${HALCYON_RAM_BYTES:-8192}
|
|
HALCYON_COMM_BYTES: ${HALCYON_COMM_BYTES:-1024}
|
|
HALCYON_ASTEROIDS: ${HALCYON_ASTEROIDS:-500}
|
|
volumes:
|
|
- data:/data
|
|
- manual:/manual:ro # the PDF manual, rendered separately (see below)
|
|
command: ["server"]
|
|
|
|
# Renders the PDF manual into the volume the web service reads. Not started by
|
|
# `docker compose up` (that stays fast); run it with scripts/render-manual.sh.
|
|
manual:
|
|
build:
|
|
context: .
|
|
target: manual
|
|
image: halcyon-manual:latest
|
|
profiles: ["manual"]
|
|
volumes:
|
|
- manual:/out
|
|
|
|
caddy:
|
|
image: caddy:2-alpine
|
|
container_name: halcyon-caddy
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- web
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
- "443:443/udp" # HTTP/3
|
|
volumes:
|
|
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
|
|
- caddy-data:/data # certificates: keep this, or you will hit rate limits
|
|
- caddy-config:/config
|
|
|
|
volumes:
|
|
data:
|
|
manual:
|
|
caddy-data:
|
|
caddy-config:
|