diff --git a/authentik/README.md b/authentik/README.md new file mode 100644 index 0000000..aa4fb3e --- /dev/null +++ b/authentik/README.md @@ -0,0 +1,5 @@ +# Authentik + +Here is the official doc: https://docs.goauthentik.io/install-config/install/docker-compose/ + +Authentik is on a 2 month release cycle and should be updated in order of release. diff --git a/authentik/docker-compose.yml b/authentik/docker-compose.yml index 2e580e6..e8c5889 100644 --- a/authentik/docker-compose.yml +++ b/authentik/docker-compose.yml @@ -1,54 +1,69 @@ - authentik: - image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2023.10.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: ${PG_PASS} - volumes: - - ./data/authentik-media:/media - - ./data/authentik-custom-templates:/templates - env_file: - - .env - ports: - - "${COMPOSE_PORT_HTTP:-9000}:9000" - - "${COMPOSE_PORT_HTTPS:-9443}:9443" - depends_on: - - postgresql - - redis - networks: - - default - - admin_web +services: - authentik-worker: - image: ghcr.io/goauthentik/server:2023.10.2 + postgresql: + 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 + image: docker.io/library/postgres:16-alpine restart: unless-stopped - command: worker + volumes: + - database:/var/lib/postgresql/data + + server: + command: server + depends_on: + postgresql: + condition: service_healthy + env_file: + - .env environment: - AUTHENTIK_REDIS__HOST: redis AUTHENTIK_POSTGRESQL__HOST: postgresql - AUTHENTIK_POSTGRESQL__USER: authentik - AUTHENTIK_POSTGRESQL__NAME: authentik + AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik} AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS} - # `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) + AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik} + AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:?secret key required} + image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.10.1} + ports: + - ${COMPOSE_PORT_HTTP:-9000}:9000 + - ${COMPOSE_PORT_HTTPS:-9443}:9443 + restart: unless-stopped + volumes: + - ./media:/media + - ./custom-templates:/templates + + worker: + command: worker + depends_on: + postgresql: + condition: service_healthy + 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} + image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.10.1} + restart: unless-stopped user: root volumes: - - /var/run/docker.sock:/var/run/docker.sock - - ./data/authentik-media:/media - - ./data/authentik-certs:/certs - - ./data/authentik-custom-templates:/templates - env_file: - - .env - depends_on: - - postgresql - - redis - networks: - - default + - /var/run/docker.sock:/var/run/docker.sock + - ./media:/media + - ./certs:/certs + - ./custom-templates:/templates + +volumes: + database: + driver: local diff --git a/authentik/sample.env b/authentik/sample.env new file mode 100644 index 0000000..21ec9d8 --- /dev/null +++ b/authentik/sample.env @@ -0,0 +1,5 @@ +#echo "PG_PASS=$(openssl rand -base64 36 | tr -d '\n')" >> .env +#echo "AUTHENTIK_SECRET_KEY=$(openssl rand -base64 60 | tr -d '\n')" >> .env +#echo "AUTHENTIK_ERROR_REPORTING__ENABLED=true" >> .env +#COMPOSE_PORT_HTTP=80 +#COMPOSE_PORT_HTTPS=443 \ No newline at end of file