diff --git a/stacks/vikunja.yml b/stacks/vikunja.yml new file mode 100644 index 0000000..eb50486 --- /dev/null +++ b/stacks/vikunja.yml @@ -0,0 +1,98 @@ +version: '3.4' + +services: + frontend: + image: 'vikunja/frontend:0.19.1' + + deploy: + # Frontend just serves some static files + mode: 'global' + labels: + - 'traefik.enable=true' + - 'traefik.http.routers.vikunja-frontend.rule=Host(`todo.rustybever.be`)' + - 'traefik.http.routers.vikunja-frontend.tls=true' + - 'traefik.http.routers.vikunja-frontend.tls.certresolver=letsEncrypt' + - 'traefik.http.services.vikunja-frontend.loadbalancer.server.port=80' + + environment: + VIKUNJA_API_URL: 'https://todo.rustybever.be/api/v1' + networks: + - 'public' + + api: + image: 'vikunja/api:0.19.2' + + deploy: + mode: 'replicated' + replicas: 1 + placement: + constraints: + 'node.labels.class.vikunja==true' + labels: + - 'traefik.enable=true' + - 'traefik.http.routers.vikunja-api.rule=Host(`todo.rustybever.be`) && PathPrefix(`/api/`, `/dav/`, `/\.well-known/`)' + - 'traefik.http.routers.vikunja-api.tls=true' + - 'traefik.http.routers.vikunja-api.tls.certresolver=letsEncrypt' + - 'traefik.http.services.vikunja-api.loadbalancer.server.port=3456' + + environment: + # Database + VIKUNJA_DATABASE_HOST: 'db' + VIKUNJA_DATABASE_TYPE: 'postgres' + VIKUNJA_DATABASE_USER: 'vikunja' + VIKUNJA_DATABASE_PASSWORD: 'vikunja' + + # Redis cache + VIKUNJA_REDIS_ENABLED: 1 + VIKUNJA_REDIS_HOST: 'redis:6379' + VIKUNJA_CACHE_ENABLED: 1 + VIKUNJA_CACHE_TYPE: redis + + VIKUNJA_SERVICE_JWTSECRET: + VIKUNJA_SERVICE_FRONTENDURL: 'https://todo.rustybever.be/' + VIKUNJA_SERVICE_ENABLEREGISTRATION: false + networks: + - 'default' + - 'public' + volumes: + - 'api-data:/app/vikunja/files' + + db: + image: 'postgres:14.5' + + deploy: + mode: 'replicated' + replicas: 1 + placement: + constraints: + - 'node.labels.class.vikunja==true' + + environment: + POSTGRES_USER: 'vikunja' + POSTGRES_PASSWORD: 'vikunja' + volumes: + - 'db-data:/var/lib/postgresql/data' + + redis: + image: 'redis:7.0.5-alpine' + + healthcheck: + test: 'redis-cli -h localhost ping' + interval: '10s' + timeout: '5s' + retries: 3 + + deploy: + mode: 'replicated' + replicas: 1 + placement: + constraints: + - 'node.labels.class.vikunja==true' + +networks: + public: + external: true + +volumes: + api-data: + db-data: