pneumatube/docker-compose.yml
2026-10-05 12:20:26 +03:00

59 lines
2.8 KiB
YAML

# Local test rig for the Postfix -> LMTP -> pneumatube wiring, matching the
# shape of a real deployment: Postfix owns the SMTP side, pneumatube is its
# LMTP delivery backend. This is NOT the recommended production topology —
# a real deployment runs Postfix on the host with real TLS/DNS, not in a
# container (see the project's Postfix wiring notes); this rig has no TLS,
# no abuse limits, and trusts every connecting host (mynetworks=0.0.0.0/0).
#
# Requires PNEUMATUBE_SMOLMAIL_DOMAIN and PNEUMATUBE_SMTP_RELAY_HOST set in
# the environment or a .env file. The gateway's own smolmail account must
# already be registered against that server before pneumatube can run —
# the same bootstrap as any smolmail client, using the fumi CLI that ships
# inside the image and ./data as --key/--db:
#
# docker compose run --rm pneumatube \
# fumi --key /data/gateway.key --db /data/gateway.db keygen
# docker compose run --rm pneumatube \
# fumi --key /data/gateway.key --db /data/gateway.db trust <host> <server-key>
# docker compose run --rm pneumatube \
# fumi --key /data/gateway.key --db /data/gateway.db register <user>@<host>
services:
pneumatube:
# The build context is the parent directory, because Cargo path-depends
# on the sibling fumi checkout (../fumi/core) for the smolmail protocol.
build:
context: ..
dockerfile: pneumatube/Dockerfile
volumes:
- ./data:/data
environment:
PNEUMATUBE_SMOLMAIL_KEY: /data/gateway.key
PNEUMATUBE_SMOLMAIL_DB: /data/gateway.db
PNEUMATUBE_SMOLMAIL_DOMAIN: ${PNEUMATUBE_SMOLMAIL_DOMAIN:?set the smolmail server address}
PNEUMATUBE_EMAIL_DOMAIN: ${PNEUMATUBE_EMAIL_DOMAIN:-gateway.example}
PNEUMATUBE_LISTEN_PROTOCOL: lmtp
PNEUMATUBE_LISTEN_HOST: 0.0.0.0
PNEUMATUBE_LISTEN_PORT: "2424"
PNEUMATUBE_LOOKUP_HOST: 0.0.0.0
PNEUMATUBE_LOOKUP_PORT: "2526"
PNEUMATUBE_REQUIRE_ACCEPTED_SENDER: ${PNEUMATUBE_REQUIRE_ACCEPTED_SENDER:-1}
PNEUMATUBE_REQUIRE_ACCEPTED_RECIPIENT: ${PNEUMATUBE_REQUIRE_ACCEPTED_RECIPIENT:-1}
PNEUMATUBE_SMTP_RELAY_HOST: ${PNEUMATUBE_SMTP_RELAY_HOST:?set an outbound relay host}
PNEUMATUBE_SMTP_RELAY_PORT: ${PNEUMATUBE_SMTP_RELAY_PORT:-587}
PNEUMATUBE_SMTP_RELAY_USER: ${PNEUMATUBE_SMTP_RELAY_USER:-}
PNEUMATUBE_SMTP_RELAY_PASSWORD: ${PNEUMATUBE_SMTP_RELAY_PASSWORD:-}
PNEUMATUBE_SMTP_RELAY_STARTTLS: ${PNEUMATUBE_SMTP_RELAY_STARTTLS:-1}
PNEUMATUBE_GATEWAY_FROM_ADDRESS: ${PNEUMATUBE_GATEWAY_FROM_ADDRESS:-gateway@gateway.example}
postfix:
build: ./docker/postfix
depends_on:
- pneumatube
environment:
POSTFIX_RELAY_DOMAIN: ${PNEUMATUBE_EMAIL_DOMAIN:-gateway.example}
PNEUMATUBE_HOST: pneumatube
PNEUMATUBE_PORT: "2424"
PNEUMATUBE_LOOKUP_PORT: "2526"
ports:
- "2525:25"