Files
BFlat 92e3622177 M9: figcraft-server checks its own health in a container, and runs with Docker Compose (#2044, part) (#2903)
figcraft-server healthcheck asks the server on the listen address for /healthz (exit 0 on 200, 1 otherwise), and the distroless image declares it as its HEALTHCHECK. packaging/server/docker-compose.yml builds the image and takes its FIGCRAFT_SERVER_* settings from a .env file beside it, with trusted_proxy defaulting to Docker's address range and the port on loopback. docs/server.md covers the subcommand, Compose, and running behind a platform proxy that ends TLS. Part of #2044.
2026-12-02 08:27:23 +07:00

31 lines
1.2 KiB
YAML

# figcraft-server with Docker Compose; setup in docs/server.md ("With Docker Compose"). From this
# directory, with a TLS reverse proxy on this machine in front of port 47900:
#
# echo FIGCRAFT_SERVER_PUBLIC_URL=wss://figcraft.example.com/ > .env
# docker compose up -d --build
# docker compose exec figcraft-server figcraft-server --config /etc/figcraft-server/server.toml key
#
# .env holds the settings, one FIGCRAFT_SERVER_* variable a line (docs/server.md, "Configuration");
# upgrades read it again.
# The image's health check asks the server for /healthz.
services:
figcraft-server:
build:
context: ../..
dockerfile: packaging/server/Dockerfile
image: figcraft-server
restart: unless-stopped
env_file: .env
environment:
# Where the proxy's connections come from (the containers' address range), so the limits
# per address count the people behind it.
FIGCRAFT_SERVER_TRUSTED_PROXY: ${FIGCRAFT_SERVER_TRUSTED_PROXY:-172.16.0.0/12}
# Loopback only: ports Docker publishes bypass the firewall, so the proxy is the way in.
ports:
- "127.0.0.1:47900:47900"
volumes:
- figcraft-data:/data
volumes:
figcraft-data: