2021-04-11 03:51:00 +07:00
|
|
|
---
|
2020-01-19 17:06:37 +07:00
|
|
|
version: '3.4'
|
2018-10-12 12:52:44 +07:00
|
|
|
services:
|
|
|
|
authelia:
|
2019-12-24 09:14:52 +07:00
|
|
|
image: authelia/authelia:latest
|
2018-10-12 12:52:44 +07:00
|
|
|
# Used for Docker configs
|
|
|
|
configs:
|
2018-10-12 12:56:27 +07:00
|
|
|
- source: authelia
|
2020-06-17 13:25:35 +07:00
|
|
|
target: /config/configuration.yml
|
2020-01-19 17:06:37 +07:00
|
|
|
uid: '0'
|
|
|
|
gid: '0'
|
2021-04-11 03:51:00 +07:00
|
|
|
mode: 0444 # yamllint disable-line rule:octal-values
|
2018-10-12 12:52:44 +07:00
|
|
|
environment:
|
|
|
|
- NODE_TLS_REJECT_UNAUTHORIZED=0
|
2021-04-11 03:51:00 +07:00
|
|
|
# Where the authelia volume is to be mounted. To only use a single volume, the minimal config
|
|
|
|
# needs to be changed to read the users_database.yml also from this subdirectory.
|
2018-10-12 20:57:46 +07:00
|
|
|
# Otherwise a second volume will need to be configured here to mount the users_database.yml.
|
2018-10-12 12:52:44 +07:00
|
|
|
volumes:
|
2020-06-17 13:25:35 +07:00
|
|
|
- authelia:/config/storage
|
2018-10-12 12:52:44 +07:00
|
|
|
networks:
|
|
|
|
- overlay
|
|
|
|
deploy:
|
2021-04-11 03:51:00 +07:00
|
|
|
# Configure Authelia to automatically restart on failure.
|
2018-10-12 12:52:44 +07:00
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
delay: 5s
|
|
|
|
max_attempts: 3
|
|
|
|
window: 120s
|
2021-04-11 03:51:00 +07:00
|
|
|
# Mode: global would start authelia on all available nodes,
|
|
|
|
# replicated limits it to how many replicas are configured.
|
2018-10-12 12:52:44 +07:00
|
|
|
mode: replicated
|
|
|
|
# How many replicas are wanted. Can be any number >0 up to however many nodes are available.
|
|
|
|
replicas: 1
|
|
|
|
placement:
|
2018-10-12 20:57:46 +07:00
|
|
|
constraints:
|
2018-10-12 12:52:44 +07:00
|
|
|
- node.role == worker
|
|
|
|
|
2021-04-11 03:51:00 +07:00
|
|
|
# The volume for authelia needs to be configured.
|
|
|
|
# There are many drivers available. Such as local storage, ceph-rdb, nfs, cifs etc.
|
2018-10-12 12:52:44 +07:00
|
|
|
volumes:
|
|
|
|
authelia:
|
|
|
|
driver: default
|
|
|
|
name: volume-authelia
|
|
|
|
|
|
|
|
networks:
|
|
|
|
overlay:
|
|
|
|
external: true
|
|
|
|
|
|
|
|
# This is needed if Docker configs are being used to provide Authelia with its configuration.
|
|
|
|
configs:
|
|
|
|
authelia:
|
2021-04-11 03:51:00 +07:00
|
|
|
external: true
|
|
|
|
...
|