authelia/example/swarm/docker-compose.yml
Amir Zarrinkafsh a02fb1438e Add Traefik2 suite and refactor Traefik suite (#562)
* Update Traefik 1.x to v1.7.20 for integration tests

* Add suite for Traefik 2.x

* Refactor Traefik2 suite to utilise Docker labels

* Move Traefik2 middleware definition to a file based provider

* Expose Traefik2 dashboard
The API/Dashboard can be reached at https://traefik.example.com:8080/

* Move Traefik frontend/backend definitions to Docker labels

* Move Traefik2 router/service definitions to Docker labels

* Normalise all Traefik configuration via labels and commands
When the the middleware issue with Traefik 2.x (#476) is resolved this means all Traefik related configuration can be self-contained within the respective docker-compose.yml files.

* Define ports for Authelia frontend/backend services

* Adjust Traefik2 suite to new dev workflow

* Normalise all Traefik2 middlewares via labels

* Fix typo in middleware and comment labels specifying Traefik version
2020-01-19 11:06:37 +01:00

48 lines
1.5 KiB
YAML

version: '3.4'
services:
authelia:
image: authelia/authelia:latest
# Used for Docker configs
configs:
- source: authelia
target: /etc/authelia/configuration.yml
uid: '0'
gid: '0'
mode: 0444
environment:
- NODE_TLS_REJECT_UNAUTHORIZED=0
# 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.
# Otherwise a second volume will need to be configured here to mount the users_database.yml.
volumes:
- authelia:/etc/authelia/storage
networks:
- overlay
deploy:
#Configure Authelia to automatically restart on failure.
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
# Mode: global would start authelia on all available nodes, replicated limits it to how many replicas are configured.
mode: replicated
# How many replicas are wanted. Can be any number >0 up to however many nodes are available.
replicas: 1
placement:
constraints:
- node.role == worker
#The volume for authelia needs to be configured. There are many drivers available. Such as local storage, ceph-rdb, nfs, cifs etc.
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:
external: true