Tots els compose
This commit is contained in:
103
authentik/docker-compose.yml
Normal file
103
authentik/docker-compose.yml
Normal file
@@ -0,0 +1,103 @@
|
||||
# /opt/stacks/authentik/docker-compose.yml
|
||||
|
||||
services:
|
||||
|
||||
# ── Base de dades PostgreSQL ─────────────
|
||||
postgresql:
|
||||
container_name: authentik-postgres
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_PASSWORD: '${PG_PASS}'
|
||||
POSTGRES_USER: authentik
|
||||
POSTGRES_DB: authentik
|
||||
volumes:
|
||||
- pg_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U authentik -d authentik"]
|
||||
interval: 10s
|
||||
timeout: 5s # Afegit
|
||||
retries: 5
|
||||
start_period: 30s # Afegit
|
||||
networks: [authentik_net]
|
||||
|
||||
# ── Redis per a sessions ─────────────────
|
||||
redis:
|
||||
container_name: authentik-redis
|
||||
image: redis:7.4-alpine
|
||||
restart: unless-stopped
|
||||
command: redis-server --requirepass '${REDIS_PASS}'
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "-a", "${REDIS_PASS}", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s # Afegit
|
||||
retries: 5
|
||||
start_period: 15s # Afegit
|
||||
networks: [authentik_net]
|
||||
|
||||
# ── Authentik Server (API + UI) ───────────
|
||||
server:
|
||||
container_name: authentik-server
|
||||
image: ghcr.io/goauthentik/server:2026.5.3 # Actualitzat a darrera versió estable
|
||||
restart: unless-stopped
|
||||
command: server
|
||||
environment:
|
||||
# ⚠️ NO afegir TZ aquí — trenca OAuth/SAML (doc oficial)
|
||||
AUTHENTIK_REDIS__HOST: redis
|
||||
AUTHENTIK_REDIS__PASSWORD: '${REDIS_PASS}'
|
||||
AUTHENTIK_POSTGRESQL__HOST: postgresql
|
||||
AUTHENTIK_POSTGRESQL__USER: authentik
|
||||
AUTHENTIK_POSTGRESQL__NAME: authentik
|
||||
AUTHENTIK_POSTGRESQL__PASSWORD: '${PG_PASS}'
|
||||
AUTHENTIK_SECRET_KEY: '${AUTHENTIK_SECRET_KEY}'
|
||||
AUTHENTIK_ERROR_REPORTING__ENABLED: "false" # String, no booleà YAML
|
||||
ports:
|
||||
- "127.0.0.1:9000:9000" # HTTP (només local → via Nginx)
|
||||
- "127.0.0.1:9443:9443" # HTTPS (només local → via Nginx)
|
||||
volumes:
|
||||
- authentik_media:/media
|
||||
- authentik_templates:/templates
|
||||
depends_on:
|
||||
postgresql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks: [authentik_net, shared_net]
|
||||
|
||||
# ── Authentik Worker (tasques en segon pla) ──
|
||||
worker:
|
||||
container_name: authentik-worker
|
||||
image: ghcr.io/goauthentik/server:2026.5.3 # Mateixa versió que server
|
||||
restart: unless-stopped
|
||||
command: worker
|
||||
environment:
|
||||
# ⚠️ NO afegir TZ aquí — trenca OAuth/SAML (doc oficial)
|
||||
AUTHENTIK_REDIS__HOST: redis
|
||||
AUTHENTIK_REDIS__PASSWORD: '${REDIS_PASS}'
|
||||
AUTHENTIK_POSTGRESQL__HOST: postgresql
|
||||
AUTHENTIK_POSTGRESQL__USER: authentik
|
||||
AUTHENTIK_POSTGRESQL__NAME: authentik
|
||||
AUTHENTIK_POSTGRESQL__PASSWORD: '${PG_PASS}'
|
||||
AUTHENTIK_SECRET_KEY: '${AUTHENTIK_SECRET_KEY}'
|
||||
volumes:
|
||||
- authentik_media:/media
|
||||
- authentik_templates:/templates # Afegit: worker també necessita templates
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro # Gestió automàtica d'Outposts
|
||||
depends_on:
|
||||
postgresql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks: [authentik_net]
|
||||
|
||||
volumes:
|
||||
pg_data:
|
||||
authentik_media:
|
||||
authentik_templates:
|
||||
|
||||
networks:
|
||||
authentik_net:
|
||||
driver: bridge
|
||||
shared_net:
|
||||
external: true
|
||||
name: shared_net
|
||||
Reference in New Issue
Block a user