Jump to…
snowinitial commitqoxwzsukwmkx1mo
Matt W1# Dogfood — deployment.
Matt W2#
Matt W3# Deviations from spec §10, both forced by the environment:
Matt W4#
Matt W5# * No `postgres` service. The database is the externally provided instance in
Matt W6# .env (PostgreSQL 17 behind a TLS proxy on :6543).
Matt W7# * No `caddy` service. TLS and routing are already handled by the existing
Matt W8# caddy-proxy-manager edge (compose project `edge`), which owns :80/:443 on
Matt W9# this host. Dogfood joins its network and the edge proxies to it by
Matt W10# container name.
Matt W11
Matt W12name: dogfood
Matt W13
Matt W14services:
Matt W15 web:
Matt W16 build:
Matt W17 context: ..
Matt W18 dockerfile: docker/Dockerfile
Matt W19 target: web
Matt W20 container_name: dogfood-web
Matt W21 env_file: ../.env
Matt W22 environment:
Matt W23 BIND: 0.0.0.0:8080
Matt W24 volumes:
Matt W25 - repos:/srv/repos
Matt W26 networks:
Matt W27 - default
Matt W28 # Reachable from the edge proxy for TLS termination at dogfood.sh.
Matt W29 - edge_caddy-network
Matt W30 restart: unless-stopped
Matt W31 # Repository storage is the only thing on disk; everything else is in
Matt W32 # Postgres. Read-only root keeps a compromised process from rewriting the
Matt W33 # binary or dropping a hook script.
Matt W34 read_only: true
Matt W35 tmpfs:
Matt W36 - /tmp
Matt W37 security_opt:
Matt W38 - no-new-privileges:true
Matt W39
Matt W40 # Git over SSH. Published on 2222 because the host sshd owns :22 (spec §10
Matt W41 # assumes otherwise; the environment does not allow it), so clone URLs are
Matt W42 # ssh://git@dogfood.sh:2222/owner/repo.git.
Matt W43 ssh:
Matt W44 build:
Matt W45 context: ..
Matt W46 dockerfile: docker/Dockerfile
Matt W47 target: ssh
Matt W48 container_name: dogfood-ssh
Matt W49 env_file: ../.env
Matt W50 environment:
Matt W51 SSH_BIND: 0.0.0.0:2222
Matt W52 SSH_HOST_KEY_PATH: /etc/dogfood/ssh_host_ed25519_key
Matt W53 ports:
Matt W54 - "2222:2222"
Matt W55 volumes:
Matt W56 - repos:/srv/repos
Matt W57 # The host key must survive a redeploy or every client reports a changed
Matt W58 # host key, which is indistinguishable from an attack.
Matt W59 - ssh_keys:/etc/dogfood
Matt W60 networks:
Matt W61 - default
Matt W62 restart: unless-stopped
Matt W63 read_only: true
Matt W64 tmpfs:
Matt W65 - /tmp
Matt W66 security_opt:
Matt W67 - no-new-privileges:true
Matt W68
Matt W69 worker:
Matt W70 build:
Matt W71 context: ..
Matt W72 dockerfile: docker/Dockerfile
Matt W73 target: worker
Matt W74 container_name: dogfood-worker
Matt W75 env_file: ../.env
Matt W76 volumes:
Matt W77 - repos:/srv/repos
Matt W78 networks:
Matt W79 - default
Matt W80 restart: unless-stopped
Matt W81 read_only: true
Matt W82 tmpfs:
Matt W83 - /tmp
Matt W84 security_opt:
Matt W85 - no-new-privileges:true
Matt W86
Matt W87volumes:
Matt W88 repos:
Matt W89 ssh_keys:
Matt W90
Matt W91networks:
Matt W92 edge_caddy-network:
Matt W93 external: true

93 lines · YAML