Files
ccn/Services/Website/docker-compose.yml
T
javier 242cb92bc5 Few small fixes for the Website service (#23)
This PR contains the work done to address small fixes.

To provide further details:

* HTML template
  * Removed the duplicate charset <meta> tag from the Page protocol's head property.

* Router
  * Enabled auto-generated HEAD endpoints so every GET route gets a HEAD sibling. Uptime monitors and crawlers probing with HEAD now receive the page's status and headers instead of a 404.

* Docker
  * Pinned the asset optimizer versionsvia build args so minified output is reproducible for a given Dockerfile commit.
  * Narrowed the build context copied into the release stage, only package manifests and Swift sources are copied. Static assets come from the separate assets stage after the binary is built.
  * svgo now minifies all SVGs recursively rather than just icon.svg, and the staging step creates Resources/Static explicitly instead of conditionally moving the unminified sources.
  * Added curl to the runtime image (needed for the container healthcheck) and .claude to .dockerignore.

* Docker-compose
  * Added a `healthcheck` to the website service hitting GET /health (liveness only), so Compose reports process health without coupling container health to database reachability.

Reviewed-on: rock-n-code/loud-amsterdam#23
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-07-19 18:23:46 +00:00

40 lines
1.6 KiB
YAML

name: loud-platform
# Production base configuration.
# Deploys a pre-built image pulled from a registry — no build step.
#
# docker compose -f docker-compose.yml pull
# docker compose -f docker-compose.yml up -d
#
# The `-f docker-compose.yml` flag is important in production: it skips the
# docker-compose.override.yml file, which Compose would otherwise merge in
# automatically for local development.
services:
website:
image: ${HOST_CONTAINER}/${HOST_OWNER}/${IMAGE_NAME}:${IMAGE_TAG:-latest}
platform: linux/amd64
container_name: ${HOST_OWNER}-${IMAGE_NAME}
restart: unless-stopped
ports:
- "${HOST_PORT:-8080}:8080"
environment:
LOG_LEVEL: ${LOG_LEVEL:-info}
HTTP_SERVER_NAME: ${HTTP_SERVER_NAME:-LoudWebsite}
SECURITY_STRICT_TRANSPORT_SECURITY: "${SECURITY_STRICT_TRANSPORT_SECURITY:-max-age=31536000; includeSubDomains}"
# Persistence: in-memory by default; set DATABASE_DRIVER=mysql to run against a
# managed MySQL/MariaDB database. Provide the password via the environment or a
# secret — never commit it.
DATABASE_DRIVER: ${DATABASE_DRIVER:-mysql}
DATABASE_HOST: ${DATABASE_HOST:-localhost}
DATABASE_PORT: ${DATABASE_PORT:-3306}
DATABASE_NAME: ${DATABASE_NAME:-loud-ams}
DATABASE_USERNAME: ${DATABASE_USERNAME:-loud-ams}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-}
DATABASE_TLS: ${DATABASE_TLS:-require}
healthcheck:
test: ["CMD", "curl", "--fail", "--silent", "--show-error", "http://127.0.0.1:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s