Files

53 lines
2.4 KiB
YAML

# portfolio-next (lucaswinther.info), published from this Gitea's container registry.
# Example payload for the config repo: server/homelab/portfolio-next/docker-compose.yml
#
# nginx-proxy writes the vhost for any container on proxy-net that sets
# VIRTUAL_HOST, and acme-companion requests the certificate for LETSENCRYPT_HOST.
# proxy-net is owned by nginx-proxy.yml.
#
# The container polls the content repository over HTTPS with a read-only token, validates
# and builds each new commit, and swaps it live. Ghost, Trakt and Hardcover are fetched at
# build time (every SOURCES_INTERVAL); an outage falls back to the last cached data and
# /status names the failing source. data/ holds builds, caches and state.json, not payload.
# The image runs as uid 1000, which owns data/.
#
# :latest is a moving tag. A normal deploy keeps the image already on the host;
# picking up a new build is `-e pull=always`. To roll back, pin a commit tag:
# gitea.lucaswinther.info/lucasw89/portfolio-next:<sha>.
services:
portfolio-next:
container_name: portfolio-next
image: gitea.lucaswinther.info/lucasw89/portfolio-next:latest
restart: unless-stopped
networks:
- proxy-net
environment:
VIRTUAL_HOST: lucaswinther.info
VIRTUAL_PORT: "8080"
LETSENCRYPT_HOST: lucaswinther.info
CONTENT_REPO: https://gitea.lucaswinther.info/lucasw89/portfolio-next-content.git
CONTENT_BRANCH: main
POLL_INTERVAL: 1h
SOURCES_INTERVAL: 6h
CONTENT_REPO_TOKEN: ${CONTENT_REPO_TOKEN:?read-only Gitea token for the content repository required}
GHOST_URL: https://blog.lucaswinther.info
GHOST_CONTENT_KEY: ${GHOST_CONTENT_KEY:?Ghost Content API key required}
TRAKT_CLIENT_ID: ${TRAKT_CLIENT_ID:?Trakt client id required}
TRAKT_USER: lucasw89
LISTENBRAINZ_USER: stereotypicalcat
HARDCOVER_TOKEN: ${HARDCOVER_TOKEN:?Hardcover API token required}
# SITE_URL (canonical URLs, link previews, /sitemap.xml, the feeds) defaults to https://lucaswinther.info in
# the image; set it only to serve the site under another address.
volumes:
- ./data:/data
healthcheck:
test: ["CMD", "bun", "-e", "fetch('http://localhost:8080/status').then((r) => process.exit(r.ok ? 0 : 1), () => process.exit(1))"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
networks:
proxy-net:
external: true