gigafibre-fsm/apps/ops/infra/docker-compose.yaml
louispaulb 1ed86e37ad fix: server-side API token injection + ticket modal empty state
- Move ERPNext API token from JS bundle to nginx proxy_set_header
  (token only lives on server, never in client code)
- Switch ops + field apps from auth.targo.ca to id.gigafibre.ca SSO
- Fix "Aucun contenu" showing on tickets that have comments but no
  description (check comments.length in v-if condition)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 23:31:58 -04:00

48 lines
2.0 KiB
YAML

# Targo Ops — nginx container served at erp.gigafibre.ca/ops/
# Deploy: docker compose -f docker-compose.yaml up -d
#
# Requires:
# - Traefik proxy network
# - Authentik forwardAuth middleware in Traefik
#
# Routing:
# erp.gigafibre.ca/ops/* → Traefik → StripPrefix /ops → nginx (static SPA)
# erp.gigafibre.ca/api/* → ERPNext directly (same domain, no proxy needed)
services:
ops-frontend:
image: nginx:alpine
container_name: ops-frontend
restart: unless-stopped
volumes:
- /opt/ops-app:/usr/share/nginx/html:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- proxy
labels:
- "traefik.enable=true"
# Main router: erp.gigafibre.ca/ops/* with Authentik + StripPrefix
- "traefik.http.routers.ops.rule=Host(`erp.gigafibre.ca`) && PathPrefix(`/ops`)"
- "traefik.http.routers.ops.entrypoints=web,websecure"
- "traefik.http.routers.ops.middlewares=authentik-client@file,ops-strip@docker"
- "traefik.http.routers.ops.service=ops"
- "traefik.http.routers.ops.tls.certresolver=letsencrypt"
- "traefik.http.routers.ops.priority=200"
# StripPrefix middleware (removes /ops before sending to nginx)
- "traefik.http.middlewares.ops-strip.stripprefix.prefixes=/ops"
- "traefik.http.middlewares.ops-strip.stripprefix.forceSlash=false"
# Authentik outpost callback (required for login redirect)
- "traefik.http.routers.ops-ak.rule=Host(`erp.gigafibre.ca`) && PathPrefix(`/outpost.goauthentik.io/`)"
- "traefik.http.routers.ops-ak.entrypoints=web,websecure"
- "traefik.http.routers.ops-ak.middlewares=authentik-client@file"
- "traefik.http.routers.ops-ak.service=ops"
- "traefik.http.routers.ops-ak.tls.certresolver=letsencrypt"
- "traefik.http.routers.ops-ak.priority=250"
# Service
- "traefik.http.services.ops.loadbalancer.server.port=80"
- "traefik.docker.network=proxy"
networks:
proxy:
external: true