authentik/compose.yml

221 lines
6.5 KiB
YAML
Raw Normal View History

2022-04-13 10:04:03 +00:00
---
x-env: &env
- AUTHENTIK_POSTGRESQL__PASSWORD=file:///run/secrets/db_password
- AUTHENTIK_POSTGRESQL__USER=authentik
- AUTHENTIK_POSTGRESQL__NAME=authentik
- AUTHENTIK_POSTGRESQL__HOST=db
- AUTHENTIK_REDIS__HOST=redis
2022-04-13 10:04:03 +00:00
- AUTHENTIK_ERROR_REPORTING__ENABLED
- AUTHENTIK_SECRET_KEY=file:///run/secrets/secret_key
2022-04-13 10:04:03 +00:00
- AUTHENTIK_EMAIL__HOST
- AUTHENTIK_EMAIL__PORT
- AUTHENTIK_EMAIL__USERNAME
- AUTHENTIK_EMAIL__PASSWORD=file:///run/secrets/email_pass
2022-04-13 10:04:03 +00:00
- AUTHENTIK_EMAIL__USE_TLS
- AUTHENTIK_EMAIL__USE_SSL
- AUTHENTIK_EMAIL__TIMEOUT
- AUTHENTIK_EMAIL__FROM
- AUTHENTIK_LOG_LEVEL
2022-10-11 11:05:29 +00:00
- AUTHENTIK_SETTINGS__THEME__BACKGROUND
2022-10-19 11:32:27 +00:00
- AUTHENTIK_COLOR_BACKGROUND_LIGHT
- AUTHENTIK_FOOTER_LINKS
- AUTHENTIK_IMPERSONATION
- WELCOME_MESSAGE
- DEFAULT_LANGUAGE
- EMAIL_SUBJECT
- EMAIL_TOKEN_EXPIRY_MINUTES
- DOMAIN
2023-01-05 22:36:22 +00:00
- LOGOUT_REDIRECT
2023-04-26 16:12:49 +00:00
- APPLICATIONS
2022-04-13 10:04:03 +00:00
version: '3.8'
services:
app:
2024-04-25 17:27:52 +00:00
image: ghcr.io/goauthentik/server:2024.4.0
2022-04-13 10:04:03 +00:00
command: server
2023-12-18 07:50:37 +00:00
depends_on:
- db
- redis
secrets:
- db_password
- admin_pass
- admin_token
- secret_key
- email_pass
2022-04-13 10:04:03 +00:00
volumes:
- media:/media
2023-03-29 16:01:29 +00:00
- assets:/web/dist/assets
2023-07-20 17:31:20 +00:00
- templates:/templates
configs:
- source: custom_css
target: /web/dist/custom.css
2022-04-13 10:04:03 +00:00
networks:
- internal
- proxy
healthcheck:
2023-07-25 09:41:33 +00:00
test: "bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/9000; exit $$?;'"
2022-04-13 10:04:03 +00:00
interval: 30s
timeout: 10s
retries: 10
start_period: 5m
2022-04-13 10:04:03 +00:00
environment: *env
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=9000"
2023-10-25 13:26:38 +00:00
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
2022-04-13 10:04:03 +00:00
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect,${STACK_NAME}-frameOptions"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.customFrameOptionsValue=SAMEORIGIN"
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.contentSecurityPolicy=frame-ancestors ${X_FRAME_OPTIONS_ALLOW_FROM}"
2024-04-25 20:27:05 +00:00
- "coop-cloud.${STACK_NAME}.version=5.2.1+2024.4.0"
2023-04-13 18:47:14 +00:00
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
2022-04-13 10:04:03 +00:00
worker:
2024-04-25 17:27:52 +00:00
image: ghcr.io/goauthentik/server:2024.4.0
2022-04-13 10:04:03 +00:00
command: worker
2023-12-18 07:50:37 +00:00
depends_on:
- db
- redis
secrets:
- db_password
- admin_pass
- admin_token
- secret_key
- email_pass
2022-04-13 10:04:03 +00:00
networks:
- internal
- proxy
volumes:
- backups:/backups
- media:/media
- /dev/null:/blueprints/default/flow-oobe.yaml
2023-07-20 17:31:20 +00:00
- templates:/templates
configs:
- source: flow_recovery
target: /blueprints/1_flow_recovery.yaml
- source: flow_authentication
target: /blueprints/2_flow_authentication.yaml
- source: flow_translation
target: /blueprints/3_flow_translation.yaml
- source: flow_invitation
target: /blueprints/4_flow_invitation.yaml
2024-04-17 12:59:23 +00:00
- source: system_brand
target: /blueprints/5_system_brand.yaml
- source: flow_invalidation
target: /blueprints/6_flow_invalidation.yaml
2022-04-13 10:04:03 +00:00
environment: *env
db:
2023-11-22 20:36:27 +00:00
image: postgres:15.5
secrets:
- db_password
2023-11-22 20:36:27 +00:00
configs:
- source: db_entrypoint
target: /docker-entrypoint.sh
mode: 0555
entrypoint:
/docker-entrypoint.sh
2022-04-13 10:04:03 +00:00
volumes:
- database:/var/lib/postgresql/data
networks:
- internal
healthcheck:
2023-06-12 12:22:44 +00:00
test: ["CMD", "pg_isready", "-U", "authentik"]
2022-04-13 10:04:03 +00:00
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
environment:
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
- POSTGRES_USER=authentik
- POSTGRES_DB=authentik
2022-04-13 10:04:03 +00:00
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: "PGPASSWORD=$$(cat /run/secrets/db_password) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /var/lib/postgresql/data/backup.sql"
backupbot.backup.post-hook: "rm -rf /var/lib/postgresql/data/backup.sql"
backupbot.backup.path: "/var/lib/postgresql/data"
2022-04-13 10:04:03 +00:00
redis:
2024-02-08 17:23:07 +00:00
image: redis:7.2.4-alpine
2022-04-13 10:04:03 +00:00
networks:
- internal
healthcheck:
2023-12-18 07:50:37 +00:00
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
2022-04-13 10:04:03 +00:00
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
secrets:
db_password:
external: true
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
secret_key:
external: true
name: ${STACK_NAME}_secret_key_${SECRET_SECRET_KEY_VERSION}
admin_token:
external: true
name: ${STACK_NAME}_admin_token_${SECRET_ADMIN_TOKEN_VERSION}
admin_pass:
external: true
name: ${STACK_NAME}_admin_pass_${SECRET_ADMIN_PASS_VERSION}
email_pass:
external: true
name: ${STACK_NAME}_email_pass_${SECRET_EMAIL_PASS_VERSION}
2022-04-13 10:04:03 +00:00
networks:
proxy:
external: true
internal:
volumes:
backups:
media:
2023-07-20 17:31:20 +00:00
templates:
2023-03-29 16:01:29 +00:00
assets:
2022-04-13 10:04:03 +00:00
database:
2022-10-11 11:05:29 +00:00
configs:
custom_css:
name: ${STACK_NAME}_custom_css_${CUSTOM_CSS_VERSION}
file: custom.css.tmpl
template_driver: golang
flow_authentication:
name: ${STACK_NAME}_flow_authentication_${FLOW_AUTHENTICATION_VERSION}
file: flow_authentication.yaml.tmpl
template_driver: golang
flow_invitation:
name: ${STACK_NAME}_flow_invitation_${FLOW_INVITATION_VERSION}
file: flow_invitation.yaml.tmpl
template_driver: golang
flow_invalidation:
name: ${STACK_NAME}_flow_invalidation_${FLOW_INVALIDATION_VERSION}
file: flow_invalidation.yaml.tmpl
template_driver: golang
flow_recovery:
name: ${STACK_NAME}_flow_recovery_${FLOW_RECOVERY_VERSION}
file: flow_recovery.yaml.tmpl
template_driver: golang
flow_translation:
name: ${STACK_NAME}_flow_translation_${FLOW_TRANSLATION_VERSION}
file: flow_translation.yaml.tmpl
template_driver: golang
2024-04-17 12:59:23 +00:00
system_brand:
name: ${STACK_NAME}_system_brand_${SYSTEM_BRAND_VERSION}
file: system_brand.yaml.tmpl
template_driver: golang
2023-11-22 20:36:27 +00:00
db_entrypoint:
name: ${STACK_NAME}_db_entrypoint_${DB_ENTRYPOINT_VERSION}
file: entrypoint.postgres.sh.tmpl
template_driver: golang