services/authentik.yaml
2025-04-04 08:07:39 -05:00

147 lines
4 KiB
YAML
Executable file

services:
postgresql:
image: docker.io/library/postgres:16-alpine
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
start_period: 20s
interval: 30s
retries: 5
timeout: 5s
volumes:
- /DockerVol/Authentik/Postgres:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: F@lcon13
POSTGRES_USER: authentik
POSTGRES_DB: authentik
TZ: America/Chicago
PGID: 998
PUID: 1001
UMASK: 002
networks:
- authentik
# env_file:
# - .env
deploy:
placement:
constraints:
- node.hostname == nas
redis:
image: docker.io/library/redis:alpine
command: --save 60 1 --loglevel warning
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
environment:
TZ: America/Chicago
PGID: 998
PUID: 1001
UMASK: 002
volumes:
- /DockerVol/Authentik/redis:/data
networks:
- authentik
deploy:
placement:
constraints:
- node.hostname == nas
authentik:
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.2}
restart: unless-stopped
command: server
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__USER: authentik
AUTHENTIK_POSTGRESQL__NAME: authentik
AUTHENTIK_POSTGRESQL__PASSWORD: F@lcon13
AUTHENTIK_SECRET_KEY: g8JIvopgkcpIeRUKgfT5KwHFUwGNBFobwhHMHx08wPTJTtAlmqllAwmr6u4jk+ng8O1gbV/gwZnYylMn
TZ: America/Chicago
PGID: 998
PUID: 1001
UMASK: 002
volumes:
- /DockerVol/Authentik/media:/media
- /DockerVol/Authentik/custom-templates:/templates
networks:
- netgrimoire
- authentik
ports:
- "9080:9000"
- "9443:9443"
deploy:
placement:
constraints:
- node.hostname == nas
labels:
- homepage.group=Management
- homepage.name=Authentik
- homepage.icon=authentik.png
- homepage.href=https://auth.netgrimoire.com
- homepage.description=Account Manager
- kuma.auth.http.name="Authentik"
- kuma.auth.http.url=http://authentik:9000
- caddy=auth.netgrimoire.com
- caddy.reverse_proxy="{{upstreams 9000}}"
depends_on:
- postgresql
- redis
worker:
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.2}
restart: unless-stopped
command: worker
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__USER: authentik
AUTHENTIK_POSTGRESQL__NAME: authentik
AUTHENTIK_POSTGRESQL__PASSWORD: F@lcon13
AUTHENTIK_SECRET_KEY: g8JIvopgkcpIeRUKgfT5KwHFUwGNBFobwhHMHx08wPTJTtAlmqllAwmr6u4jk+ng8O1gbV/gwZnYylMn
TZ: America/Chicago
PGID: 998
PUID: 1001
UMASK: 002
# `user: root` and the docker socket volume are optional.
# See more for the docker socket integration here:
# https://goauthentik.io/docs/outposts/integrations/docker
# Removing `user: root` also prevents the worker from fixing the permissions
# on the mounted folders, so when removing this make sure the folders have the correct UID/GID
# (1000:1000 by default)
user: root
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /DockerVol/Authentik/media:/media
- /DockerVol/Authentik/certs:/certs
- /DockerVol/Authentik/custom-templates:/templates
networks:
- authentik
depends_on:
- postgresql
- redis
deploy:
placement:
constraints:
- node.hostname == nas
volumes:
database:
driver: local
redis:
driver: local
networks:
netgrimoire:
external: true
authentik:
external: true
# import the .env file first: set -a; . ./.env; set +a