ansible-role-docker_wikijs/templates/docker-compose.yml

60 lines
1.7 KiB
YAML

# {{ ansible_managed }}
version: '3.1'
services:
db:
image: postgres:13
environment:
POSTGRES_DB: {{ docker_wikijs_db_name }}
POSTGRES_PASSWORD: {{ docker_wikijs_db_password }}
POSTGRES_USER: {{ docker_wikijs_db_user }}
TZ: Europe/Paris
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
logging:
driver: "none"
restart: unless-stopped
volumes:
- {{ docker_wikijs_data_dir }}/{{ docker_wikijs_service_id }}/db_data:/var/lib/postgresql/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
- wikijs
wiki:
image: requarks/wiki:{{ docker_wikijs_version }}
volumes:
{%- if docker_wikijs_custom_definition +%}
- ./definition.yml:/wiki/server/modules/authentication/oidc/definition.yml
{%- endif +%}
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
db:
condition: service_healthy
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: {{ docker_wikijs_db_user }}
DB_PASS: {{ docker_wikijs_db_password }}
DB_NAME: {{ docker_wikijs_db_name }}
TZ: Europe/Paris
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.{{ docker_wikijs_service_id }}.entrypoints=web"
- "traefik.http.routers.{{ docker_wikijs_service_id }}.rule=Host(`{{ docker_wikijs_fqdn }}`)"
- "traefik.http.services.{{ docker_wikijs_service_id }}.loadbalancer.server.port=3000"
networks:
- traefik
- wikijs
networks:
traefik:
external: true
wikijs:
internal: true