link to correct docker-compos file, based on environment
This commit is contained in:
parent
2df35bf010
commit
0d7308fb4e
2 changed files with 6 additions and 1 deletions
|
@ -1,205 +0,0 @@
|
|||
---
|
||||
|
||||
services:
|
||||
geoipupdate:
|
||||
image: "maxmindinc/geoipupdate:latest"
|
||||
volumes:
|
||||
- "geoip:/usr/share/GeoIP"
|
||||
environment:
|
||||
GEOIPUPDATE_EDITION_IDS: "GeoLite2-City GeoLite2-ASN"
|
||||
GEOIPUPDATE_FREQUENCY: "8"
|
||||
GEOIPUPDATE_ACCOUNT_ID: "${GEOIPUPDATE_ACCOUNT_ID:?MaxMind GeoIP account ID required}"
|
||||
GEOIPUPDATE_LICENSE_KEY: "${GEOIPUPDATE_LICENSE_KEY:?MaxMind GeoIP license key required}"
|
||||
|
||||
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:
|
||||
- database:/var/lib/postgresql/data
|
||||
- backups_db:/var/lib/postgresql/backups
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${PG_PASS:?database password required}
|
||||
POSTGRES_USER: ${PG_USER:-authentik}
|
||||
POSTGRES_DB: ${PG_DB:-authentik}
|
||||
env_file:
|
||||
- .env
|
||||
networks:
|
||||
- backend
|
||||
|
||||
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
|
||||
volumes:
|
||||
- redis:/data
|
||||
networks:
|
||||
- backend
|
||||
|
||||
server:
|
||||
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2024.10.0}
|
||||
restart: unless-stopped
|
||||
command: server
|
||||
environment:
|
||||
AUTHENTIK_REDIS__HOST: redis
|
||||
AUTHENTIK_POSTGRESQL__HOST: postgresql
|
||||
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
|
||||
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
|
||||
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS:?PG_PASS is required. - Password for authentik's postgresql database}
|
||||
volumes:
|
||||
- ./data/authentik/media:/media
|
||||
- ./data/authentik/custom-templates:/templates
|
||||
- geoip:/geoip
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- postgresql
|
||||
- redis
|
||||
networks:
|
||||
- backend
|
||||
- frontend
|
||||
|
||||
worker:
|
||||
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2024.10.0}
|
||||
restart: unless-stopped
|
||||
command: worker
|
||||
environment:
|
||||
AUTHENTIK_REDIS__HOST: redis
|
||||
AUTHENTIK_POSTGRESQL__HOST: postgresql
|
||||
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
|
||||
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
|
||||
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS:?PG_PASS is required. - Password for authentik's postgresql database}
|
||||
# `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
|
||||
- ./data/authentik/media:/media
|
||||
- ./data/authentik/certs:/certs
|
||||
- ./data/authentik/custom-templates:/templates
|
||||
- geoip:/geoip
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- postgresql
|
||||
- redis
|
||||
networks:
|
||||
- backend
|
||||
|
||||
nginx:
|
||||
build:
|
||||
context: ./docker/nginx
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
IMAGE: "nginxinc/nginx-unprivileged:1.27.2-bookworm"
|
||||
IMG_TITLE: "nginx-unprivileged-base23"
|
||||
IMAGE_VERSION: "COMPOSE"
|
||||
depends_on:
|
||||
server:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- NGINX_HTTP_PORT=${NGINX_HTTP_PORT:-8080}
|
||||
- NGINX_HTTPS_PORT=${NGINX_HTTPS_PORT:-8443}
|
||||
- NGINX_RESOLVER=${NGINX_RESOLVER:-127.0.0.11}
|
||||
- NGINX_SERVERNAME=${NGINX_SERVERNAME:?Server name is required}
|
||||
- NGINX_SSL_SESSION_TIMEOUT=${NGINX_SSL_SESSION_TIMEOUT:-1d}
|
||||
- NGINX_SSL_SESSION_CACHE=${NGINX_SSL_SESSION_CACHE:-shared:MozSSL:10m}
|
||||
- NGINX_SSL_PROTOCOLS=${NGINX_SSL_PROTOCOLS:-TLSv1.2 TLSv1.3}
|
||||
- NGINX_SSL_CIPHERS=${NGINX_SSL_CIPHERS:-ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305}
|
||||
- NGINX_SSL_PREFER_SERVER_CIPHERS=${NGINX_SSL_PREFER_SERVER_CIPHERS:-off}
|
||||
- NGINX_HEADER_STRICT_TRANSPORT_SECURITY=${NGINX_HEADER_STRICT_TRANSPORT_SECURITY:-'"max-age=63072000" always'}
|
||||
- NGINX_SSL_STAPLING=${NGINX_SSL_STAPLING:-on}
|
||||
- NGINX_SSL_STAPLING_VERIFY=${NGINX_SSL_STAPLING_VERIFY:-on}
|
||||
volumes:
|
||||
- ./data/nginx/default.conf.template:/etc/nginx/templates/default.conf.template:ro
|
||||
- ./data/nginx/dhparams.pem:/etc/nginx/ssl/dhparams.pem:ro
|
||||
- ./data/nginx/certs:/etc/nginx/ssl/certs:ro
|
||||
- ./data/nginx/acme:/var/www/letsencrypt:ro
|
||||
ports:
|
||||
- target: 8080
|
||||
published: "80"
|
||||
protocol: tcp
|
||||
app_protocol: http # Docker Compose 2.26.0
|
||||
mode: ingress
|
||||
- target: 8443
|
||||
published: "443"
|
||||
protocol: tcp
|
||||
app_protocol: https # Docker Compose 2.26.0
|
||||
mode: ingress
|
||||
networks:
|
||||
- frontend
|
||||
|
||||
backup:
|
||||
image: registry.git.base23.de/base23/backup/resticker:0.17.0
|
||||
environment:
|
||||
PRE_COMMANDS: |-
|
||||
cd /compose-project/
|
||||
[[ $($(docker compose &>/dev/null); echo "$?") -eq 0 ]] || apk add --no-cache docker-cli-compose
|
||||
docker compose exec -T postgresql pg_dump -U ${PG_USER:-authentik} -d ${PG_DB:-authentik} -f /var/lib/postgresql/backups/${PG_DB:-authentik}.sql
|
||||
RUN_ON_STARTUP: "false"
|
||||
BACKUP_CRON: "32 2 * * *"
|
||||
RESTIC_REPOSITORY: sftp://${RESTIC_REPO_USER:?Restic repository user is required}@${RESTIC_REPO_ADDRESS:?Restic repository address is requried}:${RESTIC_REPO_PORT:?Restic repository port is required}//backup
|
||||
RESTIC_PASSWORD: '${RESTIC_REPO_PASSWORD:?Restic repository password is required}'
|
||||
RESTIC_BACKUP_SOURCES: /var/lib/postgresql/backups /var/lib/authentik/backups /var/lib/lego/backups
|
||||
RESTIC_BACKUP_ARGS: >-
|
||||
--tag ${RESTIC_TAG:?Restic tag is required}
|
||||
--verbose
|
||||
RESTIC_FORGET_ARGS: >-
|
||||
--keep-last 10
|
||||
--keep-daily 7
|
||||
--keep-weekly 5
|
||||
--keep-monthly 12
|
||||
TZ: Europe/Berlin
|
||||
volumes:
|
||||
- ./data/restic/ssh/:/run/secrets/.ssh:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./docker-compose.yml:/compose-project/docker-compose.yml:ro
|
||||
- ./.env:/compose-project/.env:ro
|
||||
- backups_db:/var/lib/postgresql/backups:ro
|
||||
- ./data/authentik/certs:/var/lib/authentik/backups/certs:ro
|
||||
- ./data/authentik/custom-templates:/var/lib/authentik/backups/templates:ro
|
||||
- ./data/authentik/media:/var/lib/authentik/backups/media:ro
|
||||
- ./data/.lego:/var/lib/lego/backups:ro
|
||||
|
||||
prune-backup:
|
||||
image: registry.git.base23.de/base23/backup/resticker:0.17.0
|
||||
environment:
|
||||
SKIP_INIT: "true"
|
||||
RUN_ON_STARTUP: "false"
|
||||
PRUNE_CRON: "47 3 * * *"
|
||||
RESTIC_REPOSITORY: sftp://${RESTIC_REPO_USER:?Restic repository user is required}@${RESTIC_REPO_ADDRESS:?Restic repository address is requried}:${RESTIC_REPO_PORT:?Restic repository port is required}//backup
|
||||
RESTIC_PASSWORD: '${RESTIC_REPO_PASSWORD:?Restic repository password is required}'
|
||||
TZ: Europe/Berlin
|
||||
volumes:
|
||||
- ./data/restic/ssh/:/run/secrets/.ssh:ro
|
||||
|
||||
|
||||
volumes:
|
||||
backups_db:
|
||||
driver: local
|
||||
database:
|
||||
driver: local
|
||||
redis:
|
||||
driver: local
|
||||
geoip:
|
||||
driver: local
|
||||
|
||||
|
||||
networks:
|
||||
backend:
|
||||
frontend:
|
Loading…
Add table
Add a link
Reference in a new issue