refactor: sepparate traefik and authentik

This commit is contained in:
2025-12-08 13:30:32 +01:00
parent f3b73bae11
commit aed28ed15c
4 changed files with 125 additions and 94 deletions
-19
View File
@@ -1,22 +1,3 @@
# ===================================
# Traefik envs
EMAIL=bobrovod@national.shitposting.agency
# ===================================
# Authentification app (authentik)
# PostgresQL conf
PG_PASS=change_this_cuz_its_ur_db_pass
PG_USER=authentik # it's okay
# Image Settings
AUTHENTIK_IMAGE=ghcr.io/goauthentik/server
AUTHENTIK_TAG=2025.10.2
# Networking
PORT_HTTP=9000
PORT_HTTPS=9443 # btw likely already used by portainer
AUTHENTIK_SECRET_KEY=super_secret_super_scary_authenik_key
AUTHENTIK_ERROR_REPORTING__ENABLED=true # Or false to turn off
-75
View File
@@ -86,81 +86,6 @@ services:
environment:
- TZ=Europe/Bratislava
postgresql:
image: docker.io/library/postgres:15
restart: unless-stopped
container_name: authentik-postgresql
env_file:
- .env
environment:
POSTGRES_DB: ${PG_DB:-authentik}
POSTGRES_PASSWORD: ${PG_PASS:?database password required}
POSTGRES_USER: ${PG_USER:-authentik}
volumes:
- auth-database:/var/lib/postgresql/data
healthcheck:
interval: 30s
retries: 5
start_period: 20s
test:
- CMD-SHELL
- pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
timeout: 5s
server:
image: ghcr.io/goauthentik/server:${AUTHENTIK_TAG:-2025.10.2}
restart: unless-stopped
container_name: authentik-server
command: server
ports:
- ${PORT_HTTP:-9000}:9000
- ${PORT_HTTPS:-9443}:9443
env_file:
- .env
environment:
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:?secret key required}
volumes:
- ./auth-media:/media
- ./auth-custom-templates:/templates
networks:
- traefik-proxy
depends_on:
postgresql:
condition: service_healthy
worker:
image: ghcr.io/goauthentik/server:${AUTHENTIK_TAG:-2025.10.2}
restart: unless-stopped
container_name: authentik-worker
command: worker
user: root
env_file:
- .env
environment:
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:?secret key required}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./auth-media:/media
- ./certs:/certs
- ./auth-custom-templates:/templates
depends_on:
postgresql:
condition: service_healthy
networks:
- traefik-proxy
volumes:
auth-database:
driver: local
networks:
traefik-proxy:
external: true