refactor: sepparate traefik and authentik
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
# ===================================
|
||||||
|
# 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_BOOTSTRAP_PASSWORD=pls_change_this
|
||||||
|
|
||||||
|
AUTHENTIK_ERROR_REPORTING__ENABLED=true # Or false to turn off
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
services:
|
||||||
|
postgresql:
|
||||||
|
image: docker.io/library/postgres:15-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ${PG_DB:-authentik}
|
||||||
|
POSTGRES_PASSWORD: ${PG_PASS:?database password required}
|
||||||
|
POSTGRES_USER: ${PG_USER:-authentik}
|
||||||
|
healthcheck:
|
||||||
|
interval: 30s
|
||||||
|
retries: 5
|
||||||
|
start_period: 20s
|
||||||
|
test:
|
||||||
|
- CMD-SHELL
|
||||||
|
- pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
|
||||||
|
timeout: 5s
|
||||||
|
volumes:
|
||||||
|
- database:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- authentik
|
||||||
|
|
||||||
|
server:
|
||||||
|
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.10.2}
|
||||||
|
command: server
|
||||||
|
restart: unless-stopped
|
||||||
|
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}
|
||||||
|
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.docker.network=traefik-proxy"
|
||||||
|
# Services
|
||||||
|
# - "traefik.http.services.authentik-server.loadbalancer.server.port=9443"
|
||||||
|
- "traefik.http.services.authentik-server.loadbalancer.server.port=9000"
|
||||||
|
|
||||||
|
# Prod Router
|
||||||
|
- "traefik.http.routers.authentik-server.rule=Host(`auth.forust.xyz`)"
|
||||||
|
- "traefik.http.routers.authentik-server.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.authentik-server.middlewares=security-headers@file"
|
||||||
|
- "traefik.http.routers.authentik-server.service=authentik-server"
|
||||||
|
- "traefik.http.routers.authentik-server.tls=true"
|
||||||
|
|
||||||
|
# Local Router
|
||||||
|
- "traefik.http.routers.authentik-server-local.rule=Host(`auth.workstation.internal`) || Host(`auth-dashboard.internal`)"
|
||||||
|
- "traefik.http.routers.authentik-server-local.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.authentik-server-local.middlewares=security-headers@file"
|
||||||
|
- "traefik.http.routers.authentik-server-local.service=authentik-server"
|
||||||
|
- "traefik.http.routers.authentik-server-local.tls=true"
|
||||||
|
|
||||||
|
# Dev Router
|
||||||
|
- "traefik.http.routers.authentik-server-dev.rule=Host(`auth.gigaforust.internal`)"
|
||||||
|
- "traefik.http.routers.authentik-server-dev.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.authentik-server-dev.middlewares=security-headers@file"
|
||||||
|
- "traefik.http.routers.authentik-server-dev.service=authentik-server"
|
||||||
|
- "traefik.http.routers.authentik-server-dev.tls=true"
|
||||||
|
volumes:
|
||||||
|
- ./media:/media
|
||||||
|
- ./custom-templates:/templates
|
||||||
|
networks:
|
||||||
|
- traefik-proxy
|
||||||
|
- authentik
|
||||||
|
depends_on:
|
||||||
|
postgresql:
|
||||||
|
condition: service_healthy
|
||||||
|
worker:
|
||||||
|
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.10.2}
|
||||||
|
restart: unless-stopped
|
||||||
|
user: root
|
||||||
|
command: worker
|
||||||
|
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
|
||||||
|
- ./media:/media
|
||||||
|
- ./certs:/certs
|
||||||
|
- ./custom-templates:/templates
|
||||||
|
networks:
|
||||||
|
- authentik
|
||||||
|
depends_on:
|
||||||
|
postgresql:
|
||||||
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
database:
|
||||||
|
driver: local
|
||||||
|
networks:
|
||||||
|
authentik:
|
||||||
|
traefik-proxy:
|
||||||
|
external: true
|
||||||
@@ -1,22 +1,3 @@
|
|||||||
# ===================================
|
# ===================================
|
||||||
# Traefik envs
|
# Traefik envs
|
||||||
EMAIL=bobrovod@national.shitposting.agency
|
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
|
|
||||||
@@ -86,81 +86,6 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Bratislava
|
- 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:
|
networks:
|
||||||
traefik-proxy:
|
traefik-proxy:
|
||||||
external: true
|
external: true
|
||||||
|
|||||||
Reference in New Issue
Block a user