Files

196 lines
8.0 KiB
YAML

---
services:
app:
image: ghcr.io/hopps-app/hopps/frontend:2.5.0
networks:
- proxy
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
- "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}"
## Edit the following line if you are using one, but not both, "Redirect" sections below
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirectscheme,${STACK_NAME}-redirecthostname"
## 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=1.0.0+2.5.0"
environment:
VITE_TITLE: ${VITE_TITLE:-Hopps}
VITE_GENERAL_DATE_FORMAT: ${VITE_GENERAL_DATE_FORMAT:-dd.MM.yyyy}
VITE_API_ORG_URL: ${PUBLIC_ORG_URL}
# -- login at the external OIDC provider (the browser talks to it directly)
VITE_OIDC_PROVIDER_URL: ${PUBLIC_OIDC_ISSUER_URL:-}
VITE_OIDC_CLIENT_ID: ${OIDC_CLIENT_ID:-}
# Authentik only issues a refresh token when offline_access is requested.
VITE_OIDC_SCOPE: ${OIDC_SCOPE:-openid profile email offline_access}
# Impressum / Datenschutzerklärung. Either link an external page here, or
# mount your own content via the volume below. See legal/README.md.
HOPPS_IMPRINT_URL: ${HOPPS_IMPRINT_URL:-}
HOPPS_PRIVACY_URL: ${HOPPS_PRIVACY_URL:-}
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost"]
# interval: 30s
# timeout: 10s
# retries: 10
# start_period: 1m
# ---------------------------------------------------------------- backend ---
org:
image: ghcr.io/hopps-app/hopps/org:2.5.0
networks:
- proxy
- internal
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.swarm.network=proxy"
- "traefik.http.services.${STACK_NAME}-org.loadbalancer.server.port=8080"
- "traefik.http.routers.${STACK_NAME}-org.rule=Host(`org.${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-org.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-org.tls=true"
- "traefik.http.routers.${STACK_NAME}-org.tls.certresolver=${LETS_ENCRYPT_ENV}"
## Edit the following line if you are using one, but not both, "Redirect" sections below
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirectscheme,${STACK_NAME}-redirecthostname"
## 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"
## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
# - "backupbot.backup.path=/some/path"
environment:
# -- database
QUARKUS_DATASOURCE_USERNAME: hopps
QUARKUS_DATASOURCE_PASSWORD:
QUARKUS_DATASOURCE_PASSWORD_FILE: /run/secrets/db_password
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://postgres:5432/org
# -- tenancy: one association per installation (see .env.example)
HOPPS_TENANCY_MODE: ${HOPPS_TENANCY_MODE:-single}
# -- authentication against the external OIDC provider
# Discovery may use an address only the container can reach (OIDC_INTERNAL_URL);
# the issuer inside the tokens is the public one the browser used, so it is
# asserted separately.
QUARKUS_OIDC_AUTH_SERVER_URL: ${PUBLIC_OIDC_ISSUER_URL:-}
QUARKUS_OIDC_TOKEN_ISSUER: ${PUBLIC_OIDC_ISSUER_URL:-}
QUARKUS_OIDC_CLIENT_ID: ${OIDC_CLIENT_ID:-}
QUARKUS_OIDC_APPLICATION_TYPE: service
# Who manages the member accounts, set in .env: "authentik" (an existing
# instance, configured through the OIDC_* and AUTHENTIK_* variables) or
# "keycloak" (Hopps's own, needs docker-compose.keycloak.yaml).
HOPPS_AUTH_PROVIDER: ${HOPPS_AUTH_PROVIDER:?set HOPPS_AUTH_PROVIDER in .env to authentik or keycloak}
# -- Authentik only
HOPPS_AUTHENTIK_URL: ${AUTHENTIK_URL:-}
HOPPS_AUTHENTIK_API_TOKEN: ${AUTHENTIK_API_TOKEN:-}
HOPPS_AUTHENTIK_EMAIL_STAGE_ID: ${AUTHENTIK_EMAIL_STAGE_ID:-}
# -- the SPA is served from a different origin than the API
QUARKUS_HTTP_CORS_ENABLED: "true"
QUARKUS_HTTP_CORS_ORIGINS: ${PUBLIC_SPA_URL}
# -- uploaded files (receipts, logos, bank import files) on a local volume.
# Works with a single org container only: the directory is not shared.
HOPPS_STORAGE_TYPE: local
HOPPS_STORAGE_LOCAL_ROOT: /var/lib/hopps/storage
# -- e-invoice reader. Other receipts are marked for manual entry unless
# docker-compose.document-ai.yaml is enabled.
HOPPS_ZUGFERD_SERVICE_URL: http://zugferd:8080
secrets:
- db_password
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:9000/q/health/ready || exit 1"]
interval: 10s
timeout: 5s
retries: 30
start_period: 40s
# Back this volume up together with postgres_data.
volumes:
- org_storage:/var/lib/hopps/storage
zugferd:
image: ghcr.io/hopps-app/hopps/zugferd:2.5.0
networks:
- internal
# expose:
# - "8080"
environment:
HOPPS_AZURE_OPENAI_RESOURCE_NAME: "disabled"
HOPPS_AZURE_OPENAI_DEPLOYMENT_NAME: gpt-4o-mini
HOPPS_AZURE_OPENAI_KEY: "disabled"
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:9000/q/health/ready || exit 1"]
interval: 10s
timeout: 5s
retries: 30
start_period: 40s
# ------------------------------------------------------------ persistence --
postgres:
image: postgres:16-alpine
networks:
- internal
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: hopps
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
# Created on the first start with an empty volume.
POSTGRES_DB: org
secrets:
- db_password
configs:
- source: pg_backup
target: /pg_backup.sh
mode: 0555
deploy:
restart_policy:
condition: on-failure
labels:
backupbot.backup: "${ENABLE_BACKUPS:-true}"
backupbot.backup.pre-hook: "/pg_backup.sh backup"
backupbot.backup.volumes.postgres_data.path: "backup.sql"
backupbot.restore.post-hook: "/pg_backup.sh restore"
healthcheck:
test: "pg_isready"
interval: 30s
timeout: 10s
retries: 5
start_period: 1m
configs:
pg_backup:
name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION}
file: pg_backup.sh
secrets:
db_password:
external: true
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
volumes:
postgres_data:
org_storage:
networks:
proxy:
external: true
internal: