Files
ansible/roles/docker/templates/starpunk-compose.yml.j2
T
2026-11-12 13:44:41 -07:00

96 lines
4.3 KiB
Django/Jinja

services:
starpunk:
# Built and pushed by StarPunk's Gitea Actions workflow on vX.Y.Z tags
image: {{ subdomains.git }}/phil/starpunk:{{ starpunk_version }}
container_name: starpunk
restart: unless-stopped
extra_hosts:
- '{{ subdomains.pocketid }}:{{ docker.hairpin_ip }}'
- '{{ primary_domain }}:{{ docker.hairpin_ip }}'
- '{{ subdomains.social }}:{{ docker.hairpin_ip }}'
- '{{ subdomains.gotify }}:{{ docker.hairpin_ip }}'
volumes:
- starpunk-data:/data
environment: &starpunk-env
# Site configuration
SITE_URL: https://{{ subdomains.starpunk }}
SITE_NAME: StarPunk
SITE_AUTHOR: Mr Whiskers
SITE_DESCRIPTION: Starpunk instance
# Site owner identity (h-card source, Micropub "me")
ADMIN_ME: https://{{ primary_domain }}
SESSION_SECRET: {{ vault_starpunk.session_secret }}
# Admin login via Pocket ID (client "StarPunk"); only this user may log in.
# StarPunk issues Micropub tokens itself (ADR-064).
OIDC_ISSUER: https://{{ subdomains.pocketid }}
OIDC_CLIENT_ID: {{ vault_starpunk.pocketid.client_id }}
OIDC_CLIENT_SECRET: {{ vault_starpunk.pocketid.client_secret }}
OIDC_ADMIN_SUB: {{ starpunk_admin_sub }}
OIDC_PROVIDER_NAME: Pocket ID
# Crosspost new notes to GoToSocial (app "StarPunk crossposting",
# scopes read:search read:statuses read:accounts write:statuses
# write:media write:favourites; the read scopes are for backfeed)
GOTOSOCIAL_URL: https://{{ subdomains.social }}
GOTOSOCIAL_ACCESS_TOKEN: {{ vault_starpunk.gotosocial_token }}
BLUESKY_HANDLE: phil.thesatelliteoflove.com
BLUESKY_APP_PASSWORD: {{ vault_starpunk.bluesky_app_password }}
# Threads (Meta app "starpunk"): long-lived token, StarPunk refreshes it
# daily and keeps the current one in /data/threads_token.json
THREADS_ACCESS_TOKEN: {{ vault_starpunk.threads_access_token }}
THREADS_USERNAME: philskents
# Bring likes, reposts, quotes and replies to the crossposts back to
# the notes (v2.13.0, ADR-073). The Threads token also needs
# threads_read_replies and threads_manage_insights.
BACKFEED_ENABLED: "true"
# Notify new replies to Gotify (app "StarPunk") via Apprise (v2.14.0,
# ADR-074). Replies only, by the owner's choice.
NOTIFY_URLS: gotifys://{{ subdomains.gotify }}/{{ vault_starpunk.gotify_token }}
NOTIFY_EVENTS: reply
# No webmentions to self-hosted apps that don't take them (StarPunk
# v2.18.3); this site itself is always skipped
WEBMENTION_SKIP_HOSTS: "{{ subdomains.git }}"
# Production settings
FLASK_ENV: production
# Caddy (same host, public traffic direct) sets X-Forwarded-For to the
# client address and drops any sent by the client: per-client rate
# limits on /webmention and /websub need it (StarPunk v2.10.1)
TRUSTED_PROXY: "true"
FLASK_DEBUG: 0
LOG_LEVEL: INFO
DEV_MODE: false
# MCP server for AI clients (StarPunk v2.15.0, ADR-075): same image, data
# and settings; Caddy sends /mcp and its OAuth metadata here. Tokens come
# from StarPunk's own IndieAuth server (approve at /auth/authorize).
starpunk-mcp:
image: {{ subdomains.git }}/phil/starpunk:{{ starpunk_version }}
container_name: starpunk-mcp
restart: unless-stopped
command: ["uvicorn", "starpunk.mcp_server.app:app", "--host", "0.0.0.0", "--port", "8001"]
# The image's healthcheck probes the Flask app on :8000
healthcheck:
test: ["CMD", "python3", "-c", "import socket; socket.create_connection(('localhost', 8001), 2)"]
interval: 30s
timeout: 5s
retries: 3
depends_on:
- starpunk
extra_hosts:
- '{{ subdomains.pocketid }}:{{ docker.hairpin_ip }}'
- '{{ primary_domain }}:{{ docker.hairpin_ip }}'
- '{{ subdomains.social }}:{{ docker.hairpin_ip }}'
- '{{ subdomains.gotify }}:{{ docker.hairpin_ip }}'
volumes:
- starpunk-data:/data
environment:
<<: *starpunk-env
# Only the main container runs the webmention, WebSub and syndication workers
BACKGROUND_WORKERS_ENABLED: "false"
volumes:
# Existing volume (starpunk_starpunk-data) holds the posts and database
starpunk-data:
networks:
default:
external: true
name: {{ docker.network_name }}