version: '3.8'

services:
  outline:
    image: outlinewiki/outline:latest
    container_name: outline
    restart: unless-stopped
    networks:
      - traefik-public
      - database-internal
    env_file:
      - .env
    environment:
      DATABASE_URL: postgres://outline_user:${DB_PASSWORD}@postgres-main:5432/outline?sslmode=disable
      REDIS_URL: redis://:${REDIS_PASSWORD}@redis-main:6379
      URL: https://wiki.ai-impress.com
      PORT: 3000
      SECRET_KEY: ${SECRET_KEY}
      UTILS_SECRET: ${UTILS_SECRET}
    volumes:
      - outline-data:/var/lib/outline/data
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik-public"
      - "traefik.http.routers.outline.rule=Host(`wiki.ai-impress.com`)"
      - "traefik.http.routers.outline.entrypoints=websecure"
      - "traefik.http.routers.outline.tls.certresolver=cloudflare"
      - "traefik.http.services.outline.loadbalancer.server.port=3000"
      - "traefik.http.routers.outline.middlewares=authelia@file"

volumes:
  outline-data:

networks:
  traefik-public:
    external: true
  database-internal:
    external: true
