2026-10-23 22:34:23 +07:00
|
|
|
# Repo-as-source-of-truth copy (spec-v4-deploy-infra D7/D9): rsynced to the
|
|
|
|
|
# stack directory and run there by the pipeline or Dockge. Runtime values live
|
|
|
|
|
# in secrets/site_config, which is NOT in the repository — the repo carries no
|
|
|
|
|
# site identity (D10-D13).
|
|
|
|
|
services:
|
|
|
|
|
dong-site:
|
|
|
|
|
image: nginx:alpine
|
|
|
|
|
container_name: dong-site
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
# Source the config file, then hand over to the image's official entrypoint.
|
2026-10-24 00:44:20 +07:00
|
|
|
# set -a is REQUIRED: a sourced assignment is a shell variable, not an env var —
|
|
|
|
|
# without export the entrypoint child (and its envsubst step) sees nothing and
|
2026-10-26 20:49:34 +07:00
|
|
|
# the template renders unsubstituted (reproduced locally 2026-10-23 as an
|
|
|
|
|
# "unknown variable" failure; the names are content_api_* since spec-v6). The
|
|
|
|
|
# nginx command is inline: a compose
|
2026-10-24 00:44:20 +07:00
|
|
|
# entrypoint override does NOT keep the image's CMD (CMD=[]) — an empty "$@"
|
|
|
|
|
# makes the exec a no-op, exit 0, restart loop.
|
|
|
|
|
entrypoint: ["sh", "-c", "set -a; . /run/secrets/site_config; exec /docker-entrypoint.sh nginx -g 'daemon off;'"]
|
2026-10-23 22:34:23 +07:00
|
|
|
environment:
|
2026-10-23 23:59:32 +07:00
|
|
|
# Names the variables the template renderer substitutes. The filter is a
|
|
|
|
|
# REGEX the official entrypoint matches against each variable name
|
|
|
|
|
# (`t ~ /^(filter)$/`) — alternatives MUST be separated with |, a comma
|
|
|
|
|
# matches nothing and leaves ${…} in the rendered config (nginx -t then
|
2026-10-26 20:49:34 +07:00
|
|
|
# fails with an unknown variable — reproduced 2026-10-23).
|
2026-10-23 23:59:32 +07:00
|
|
|
# $uri/$host stay nginx runtime variables. The filter is not sensitive.
|
2026-10-26 20:49:34 +07:00
|
|
|
NGINX_ENVSUBST_FILTER: CONTENT_API_TOKEN|CONTENT_API_BASE
|
2026-10-23 22:34:23 +07:00
|
|
|
volumes:
|
|
|
|
|
- ./dist:/usr/share/nginx/html:ro
|
|
|
|
|
# Mounted as a template: the image's envsubst step renders it to
|
|
|
|
|
# /etc/nginx/conf.d/default.conf with the variables sourced above.
|
|
|
|
|
- ./nginx.conf:/etc/nginx/templates/default.conf.template:ro
|
|
|
|
|
- ./deploy/htpasswd:/etc/nginx/htpasswd:ro
|
|
|
|
|
secrets:
|
|
|
|
|
- site_config
|
|
|
|
|
networks:
|
|
|
|
|
- docker-network
|
|
|
|
|
|
|
|
|
|
secrets:
|
|
|
|
|
site_config:
|
|
|
|
|
file: ./secrets/site_config
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
docker-network:
|
|
|
|
|
external: true
|