I just do any config with environment variables in the docker-compose. I assemble my docker-compose with ansible so here’s the vikunja backend (API) part from my jinja2 template (hence the curly braced variables):
vikunja-backend:
container_name: 'vikunja-backend'
image: vikunja/api
environment:
VIKUNJA_DATABASE_HOST: 'vikunja-db'
VIKUNJA_DATABASE_PASSWORD: "{{ vikunja_db_password }}"
VIKUNJA_DATABASE_TYPE: 'mysql'
VIKUNJA_DATABASE_USER: 'vikunja'
VIKUNJA_DATABASE_DATABASE: 'vikunja'
VIKUNJA_REDIS_ENABLED: 1
VIKUNJA_REDIS_HOST: 'vikunja-redis:6379'
VIKUNJA_CACHE_ENABLED: 1
VIKUNJA_CACHE_TYPE: redis
VIKUNJA_SERVICE_FRONTENDURL: "https://vikunja.{{ traefik_domain }}"
VIKUNJA_SERVICE_ENABLEREGISTRATION: 0
VIKUNJA_MIGRATION_WUNDERLIST_ENABLE: 0
VIKUNJA_MIGRATION_TODOIST_ENABLE: 1
VIKUNJA_FILES_BASEPATH: "/app/vikunja/files"
VIKUNJA_MAILER_ENABLED: 1
VIKUNJA_MAILER_HOST: "{{ fqdn }}"
VIKUNJA_MAILER_PORT: 587
VIKUNJA_MAILER_USERNAME: 'vikunja'
VIKUNJA_MAILER_PASSWORD: "{{ vikunja_email_password }}"
VIKUNJA_MAILER_FROMEMAIL: "vikunja@{{ fqdn }}"
VIKUNJA_MAILER_SKIPTLSVERIFY: 'true'
PUID: "{{ docker_user_uid }}"
PGID: "{{ docker_user_gid }}"
volumes:
- source: "{{ docker_data_dir }}/vikunja-backend"
target: '/app/vikunja/files'
type: 'bind'
depends_on:
- vikunja-db
- vikunja-redis
restart: "{{ restart_policy }}"
labels:
traefik.enable: 'true'
traefik.http.routers.vikunja-backend.rule: "Host(`vikunja.{{ traefik_domain }}`) && PathPrefix(`/api/v1`, `/dav/`)"
traefik.http.routers.vikunja-backend.tls: 'true'
#traefik.http.routers.vikunja-backend.middlewares: 'access-whitelist@file'
com.centurylinklabs.watchtower.enable: 'true'
networks:
- 'default'
- 'frontend'
Obviously the formatting will may need tweaked to use directly in a docker-compose.yml file.