102 lines
3.3 KiB
YAML
102 lines
3.3 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
app:
|
|
image: joplin/server:3.7.3
|
|
networks:
|
|
- internal
|
|
- proxy
|
|
depends_on:
|
|
- db
|
|
# ports:
|
|
# - "22300:22300"
|
|
secrets:
|
|
- db_password
|
|
environment:
|
|
- APP_PORT=22300
|
|
- APP_BASE_URL=https://${DOMAIN}
|
|
- DB_CLIENT=pg
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
- POSTGRES_DB=joplin
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_HOST=db
|
|
- MAILER_ENABLED=${MAIL_ENABLED}
|
|
- MAILER_HOST=${MAIL_HOST}
|
|
- MAILER_PORT=${MAIL_PORT}
|
|
- MAILER_SECURITY=${MAIL_SECURITY}
|
|
- MAILER_AUTH_USER=${MAIL_AUTH_USER}
|
|
- MAILER_AUTH_PASSWORD=${MAIL_AUTH_PASSWORD}
|
|
- MAILER_NOREPLY_NAME=${MAIL_NOREPLY_NAME}
|
|
- MAILER_NOREPLY_EMAIL=${MAIL_NOREPLY_EMAIL}
|
|
- LOG_LEVEL=debug
|
|
# - TRANSCRIBE_API_KEY=${TRANSCRIBE_API_KEY}
|
|
# - TRANSCRIBE_BASE_URL=http://transcribe:4567
|
|
- TRANSCRIBE_ENABLED=false
|
|
deploy:
|
|
restart_policy:
|
|
condition: on-failure
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=22300"
|
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.passhostheader=true"
|
|
# Redirect from EXTRA_DOMAINS to DOMAIN
|
|
- "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.regex=^http[s]?://([^/]*)/(.*)"
|
|
- "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.replacement=https://${DOMAIN}/$${2}"
|
|
- "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.permanent=true"
|
|
# Redirect HTTP to HTTPS
|
|
- "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.scheme=https"
|
|
- "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.permanent=true"
|
|
## When you're ready for release, run "abra recipe sync <name>" to set this
|
|
- "coop-cloud.${STACK_NAME}.version="
|
|
## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore
|
|
- "backupbot.backup=${ENABLE_BACKUPS}"
|
|
# healthcheck:
|
|
# test: ["CMD", "curl", "-f", "http://localhost"]
|
|
# interval: 30s
|
|
# timeout: 10s
|
|
# retries: 10
|
|
# start_period: 1m
|
|
|
|
db:
|
|
image: "pgautoupgrade/pgautoupgrade:16-debian"
|
|
volumes:
|
|
- "postgres:/var/lib/postgresql/data"
|
|
networks:
|
|
- internal
|
|
deploy:
|
|
labels:
|
|
backupbot.backup.pre-hook: "/pg_backup.sh backup"
|
|
backupbot.backup.volumes.postgres.path: "backup.sql"
|
|
backupbot.restore.post-hook: "/pg_backup.sh restore"
|
|
configs:
|
|
- source: pg_backup
|
|
target: /pg_backup.sh
|
|
mode: 0555
|
|
secrets:
|
|
- db_password
|
|
environment:
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
- POSTGRES_DB=joplin
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_HOST=db
|
|
|
|
volumes:
|
|
postgres:
|
|
|
|
networks:
|
|
internal:
|
|
proxy:
|
|
external: true
|
|
|
|
secrets:
|
|
db_password:
|
|
external: true
|
|
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
|
|
|
|
configs:
|
|
pg_backup:
|
|
name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION}
|
|
file: pg_backup.sh |