version: "3.7"

services:
  app_proxy:
    environment:
      APP_HOST: vikunja_web_1
      APP_PORT: 3456
      # у vikunja есть своя собственная аутентификация, поэтому нам не нужно использовать здесь прозрачную аутентификацию DFWebOS.
      PROXY_AUTH_ADD: "false"

  db:
    image: mariadb:10.11.8@sha256:75f6e61397758489d1dccf95db33b6b49ebfc7ec1253d40060fdf8ceb7f938a3
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: supersecret
      MYSQL_USER: vikunja
      MYSQL_PASSWORD: secret
      MYSQL_DATABASE: vikunja
    volumes:
      - ${APP_DATA_DIR}/data/db:/var/lib/mysql
    restart: on-failure
    healthcheck:
      test: ["CMD-SHELL", "mysqladmin ping -h localhost -u $$MYSQL_USER --password=$$MYSQL_PASSWORD"]
      interval: 2s
      start_period: 30s

  web:
    image: vikunja/vikunja:2.3.0@sha256:f6b80393c1998cd5cd0dc38d24762c59ab4c10000a6f1032ef5b554e262cab93
    environment:
      VIKUNJA_SERVICE_PUBLICURL: http://${DEVICE_DOMAIN_NAME}:4523
      VIKUNJA_DATABASE_HOST: vikunja_db_1
      VIKUNJA_DATABASE_PASSWORD: secret
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: vikunja
      VIKUNJA_DATABASE_DATABASE: vikunja
      VIKUNJA_SERVICE_JWTSECRET: ${APP_SEED}
    volumes: 
      - ${APP_DATA_DIR}/data/files:/app/vikunja/files
    depends_on:
      - db
    restart: on-failure
