# Behind Traefik with HTTPS, optionally with Authentik forward auth in front. # Assumes Traefik already runs with an entrypoint "websecure", a certificate # resolver "letsencrypt", and a Docker network "proxy" shared with it. Adjust # the names to your Traefik setup. In .env: APP_HOST=aircraft.example.com, FORCE_SSL=true. # # docker compose -f docker-compose.traefik.yml up -d # Then open https://aircraft.example.com and create the admin account with the # setup code from: docker compose -f docker-compose.traefik.yml logs web | grep "Setup code" # # Authentik: create the proxy provider and the unauthenticated URL list as in # docs/authentik.md, then uncomment the middleware lines below. Leave them out # to rely on the app's own sign-in (and optionally its single sign-on). services: web: image: barrettefab/simple-aircraft-manager-rails:latest # or your own image, or: build: . restart: unless-stopped env_file: .env environment: SOLID_QUEUE_IN_PUMA: "true" volumes: - sam_storage:/rails/storage networks: - proxy healthcheck: test: ["CMD", "curl", "-fsS", "http://localhost/up"] interval: 30s timeout: 5s retries: 3 labels: - traefik.enable=true - traefik.docker.network=proxy - traefik.http.routers.aircraft.rule=Host(`aircraft.example.com`) - traefik.http.routers.aircraft.entrypoints=websecure - traefik.http.routers.aircraft.tls.certresolver=letsencrypt - traefik.http.services.aircraft.loadbalancer.server.port=80 # --- Authentik forward auth (optional) --- # - traefik.http.routers.aircraft.middlewares=authentik@docker # The middleware itself is usually defined once, on the Authentik container: # - traefik.http.middlewares.authentik.forwardauth.address=http://authentik-server:9000/outpost.goauthentik.io/auth/traefik # - traefik.http.middlewares.authentik.forwardauth.trustForwardHeader=true # - traefik.http.middlewares.authentik.forwardauth.authResponseHeaders=X-authentik-username,X-authentik-groups,X-authentik-email,X-authentik-name,X-authentik-uid volumes: sam_storage: networks: proxy: external: true