88 lines
3.0 KiB
YAML
88 lines
3.0 KiB
YAML
|
---
|
||
|
version: "3.8"
|
||
|
|
||
|
# TODO(decentral1se):
|
||
|
# - healthchecks
|
||
|
# - how do i expose multiple ports, core and web both need to have open ports
|
||
|
# - core receives relayed emails, web receives typical http traffic
|
||
|
# - ahhh! do $name-http, $name-ltmp, "name-$proto" for entrypoints on same service
|
||
|
# - inspect if we need a nginx proxy for mailman-web, it is currently using uwsgi
|
||
|
# but apparently it can serve http but in a very limited way, need to investigate
|
||
|
# this
|
||
|
# - re-wire up all that static IP stuff so things know where each other are in
|
||
|
# the stack, e.g. https://github.com/maxking/docker-mailman/blob/master/docker-compose.yaml#L55
|
||
|
|
||
|
services:
|
||
|
# TODO(decentral1se): https://github.com/maxking/docker-mailman#mailman-core-1
|
||
|
core:
|
||
|
image: "maxking/mailman-core:0.3"
|
||
|
volumes:
|
||
|
- "core:/opt/mailman/"
|
||
|
configs:
|
||
|
- source: entrypoint_conf
|
||
|
target: /docker-entrypoint.sh
|
||
|
mode: 0555
|
||
|
# TODO(decentral1se): https://github.com/maxking/docker-mailman/blob/master/core/Dockerfile
|
||
|
# build up the right env vars required in the entrypoint via the secrets loading
|
||
|
entrypoint: /docker-entrypoint.sh
|
||
|
environment:
|
||
|
- DATABASE_CLASS=mailman.database.postgresql.PostgreSQLDatabase
|
||
|
- DATABASE_DB=mailman
|
||
|
- DATABASE_NAME=mailman
|
||
|
- DATABASE_TYPE=postgres
|
||
|
- DATABASE_USER=mailman
|
||
|
# TODO(decentral1se): https://github.com/maxking/docker-mailman/blob/master/core/Dockerfile
|
||
|
|
||
|
# TODO(decentral1se): https://github.com/maxking/docker-mailman#mailman-web-1
|
||
|
web:
|
||
|
image: "maxking/mailman-web:0.3"
|
||
|
volumes:
|
||
|
- "web:/opt/mailman-web-data"
|
||
|
configs:
|
||
|
- source: entrypoint_conf
|
||
|
target: /docker-entrypoint.sh
|
||
|
mode: 0555
|
||
|
# TODO(decentral1se): https://github.com/maxking/docker-mailman/blob/master/core/Dockerfile
|
||
|
# build up the right env vars required in the entrypoint via the secrets loading
|
||
|
entrypoint: /docker-entrypoint.sh
|
||
|
environment:
|
||
|
- DATABASE_TYPE=postgres
|
||
|
deploy:
|
||
|
update_config:
|
||
|
failure_action: rollback
|
||
|
order: start-first
|
||
|
labels:
|
||
|
- "traefik.enable=true"
|
||
|
# TODO(decentral1se): https://github.com/maxking/docker-mailman/blob/master/web/Dockerfile
|
||
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=${8000}"
|
||
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
|
||
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||
|
|
||
|
db:
|
||
|
image: "postgres:13-alpine"
|
||
|
secrets:
|
||
|
- db_password
|
||
|
environment:
|
||
|
POSTGRES_DB: mailman
|
||
|
POSTGRES_USER: mailman
|
||
|
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
|
||
|
volumes:
|
||
|
- "db:/var/lib/postgresql/data"
|
||
|
|
||
|
volumes:
|
||
|
core:
|
||
|
web:
|
||
|
db:
|
||
|
|
||
|
secrets:
|
||
|
db_password:
|
||
|
external: true
|
||
|
name: ${STACK_NAME}_db_root_password_${DB_ROOT_PASSWORD_VERSION}
|
||
|
|
||
|
configs:
|
||
|
entrypoint_conf:
|
||
|
name: ${STACK_NAME}_entrypoint_conf_${ENTRYPOINT_CONF_VERSION}
|
||
|
file: entrypoint.sh.tmpl
|
||
|
template_driver: golang
|