version: "3" services: proxy: image: traefik:v3.0.2 command: # - "--log.level=DEBUG" # - "--api=true" # - "--api.dashboard=true" # - "--api.insecure=true" # Don't do that in production # - "--providers.docker" # - "--entrypoints.web.address=:80" # add pilot token service # - "--pilot.token=3d1bd97f-cb9d-4cde-8112-77ce2f5abc92" # install plugin rewrite body # - "--experimental.plugins.plugin-rewrite.modulename=github.com/traefik/plugin-rewritebody" # - "--experimental.plugins.plugin-rewrite.version=v0.3.1" labels: {} # Create basics middlewares # - "traefik.http.middlewares.my-auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/" # - "traefik.http.middlewares.my-compress.compress=true" # - "traefik.http.middlewares.my-header.headers.customresponseheaders.X-Custom-Response-Header=cinema" # Create middlewares for plugins # - "traefik.http.middlewares.my-rewrite.plugin.plugin-rewrite.lastModified=true" # - "traefik.http.middlewares.my-rewrite.plugin.plugin-rewrite.rewrites[0].regex=ID" # - "traefik.http.middlewares.my-rewrite.plugin.plugin-rewrite.rewrites[0].replacement=MY-ID" volumes: # Mount the traefik.toml config file - ./hack/traefik.toml:/etc/traefik/traefik.toml - type: bind source: /var/run/docker.sock target: /var/run/docker.sock read_only: true ports: - target: 80 published: 80 protocol: tcp mode: host - target: 8080 published: 8080 protocol: tcp mode: host website: build: ./website # image: ghcr.io/mmorejon/cinema-website:v2.2.2 command: - "-usersAPI" - "http://users:4000/api/users/" - "-moviesAPI" - "http://movies:4000/api/movies/" - "-showtimesAPI" - "http://showtimes:4000/api/showtimes/" - "-bookingsAPI" - "http://bookings:4000/api/bookings/" labels: # Enable public access - "traefik.http.routers.website.rule=PathPrefix(`/`)" - "traefik.http.services.website.loadbalancer.server.port=8000" environment: - OTEL_METRICS_EXPORTER=otlp - OTEL_LOGS_EXPORTER=otlp - OTEL_RESOURCE_ATTRIBUTES=service.name=website,service.version=${WEBSITE_SERVICE_VERSION},deployment.environment=${SERVICE_ENVIRONMENT} env_file: - .env movies: build: ./movies # image: ghcr.io/mmorejon/cinema-movies:v2.2.2 command: - "-mongoURI" - "mongodb://db:27017/" # - "-enableCredentials" # - "true" # environment: # MONGODB_USERNAME: "demo" # MONGODB_PASSWORD: "e3LBVTPdlzxYbxt9" labels: - "traefik.enable=false" # Enable public access # - "traefik.http.routers.movies.rule=PathPrefix(`/api/movies/`)" # - "traefik.http.services.movies.loadbalancer.server.port=4000" # Apply middlewares # - "traefik.http.routers.movies.middlewares=my-header,my-compress" environment: - OTEL_METRICS_EXPORTER=otlp - OTEL_LOGS_EXPORTER=otlp - OTEL_RESOURCE_ATTRIBUTES=service.name=movies,service.version=${MOVIES_SERVICE_VERSION},deployment.environment=${SERVICE_ENVIRONMENT} env_file: - .env bookings: build: ./bookings # image: ghcr.io/mmorejon/cinema-bookings:v2.2.2 command: - "-mongoURI" - "mongodb://db:27017/" # - "-enableCredentials" # - "true" # environment: # MONGODB_USERNAME: "demo" # MONGODB_PASSWORD: "e3LBVTPdlzxYbxt9" labels: - "traefik.enable=false" # Enable public access # - "traefik.http.routers.bookings.rule=PathPrefix(`/api/bookings/`)" # - "traefik.http.services.bookings.loadbalancer.server.port=4000" environment: - OTEL_METRICS_EXPORTER=otlp - OTEL_LOGS_EXPORTER=otlp - OTEL_RESOURCE_ATTRIBUTES=service.name=bookings,service.version=${BOOKINGS_SERVICE_VERSION},deployment.environment=${SERVICE_ENVIRONMENT} env_file: - .env showtimes: build: ./showtimes # image: ghcr.io/mmorejon/cinema-showtimes:v2.2.2 command: - "-mongoURI" - "mongodb://db:27017/" # - "-enableCredentials" # - "true" # environment: # MONGODB_USERNAME: "demo" # MONGODB_PASSWORD: "e3LBVTPdlzxYbxt9" labels: - "traefik.enable=false" # Enable public access # - "traefik.http.routers.showtimes.rule=PathPrefix(`/api/showtimes/`)" # - "traefik.http.services.showtimes.loadbalancer.server.port=4000" environment: - OTEL_METRICS_EXPORTER=otlp - OTEL_LOGS_EXPORTER=otlp - OTEL_RESOURCE_ATTRIBUTES=service.name=showtimes,service.version=${SHOWTIMES_SERVICE_VERSION},deployment.environment=${SERVICE_ENVIRONMENT} env_file: - .env users: build: ./users # image: ghcr.io/mmorejon/cinema-users:v2.2.2 command: - "-mongoURI" - "mongodb://db:27017/" # - "-enableCredentials" # - "true" # environment: # MONGODB_USERNAME: "demo" # MONGODB_PASSWORD: "e3LBVTPdlzxYbxt9" labels: - "traefik.enable=false" # Enable public access # - "traefik.http.routers.users.rule=PathPrefix(`/api/users/`)" # - "traefik.http.services.users.loadbalancer.server.port=4000" environment: - OTEL_METRICS_EXPORTER=otlp - OTEL_LOGS_EXPORTER=otlp - OTEL_RESOURCE_ATTRIBUTES=service.name=users,service.version=${USERS_SERVICE_VERSION},deployment.environment=${SERVICE_ENVIRONMENT} env_file: - .env db: image: mongo:4.4.29 # ports: # - target: 27017 # published: 27017 # protocol: tcp # mode: host volumes: - type: bind source: ./backup target: /backup labels: - "traefik.enable=false" prometheus: image: prom/prometheus:v2.52.0 ports: - 9090:9090 command: - "--config.file=/etc/prometheus/prom.yml" restart: always volumes: # Store Prometheus data in a volume: - prom_data:/prometheus # Mount the prom.yml config file - ./hack/prom.yml:/etc/prometheus/prom.yml labels: - "traefik.enable=false" otelcol: image: otel/opentelemetry-collector:0.102.1 restart: always ports: - 8889:8889 depends_on: - prometheus volumes: # Mount the otelcol.yml config file - ./hack/otelcol.yml:/etc/otelcol/config.yaml labels: - "traefik.enable=false" grafana: image: grafana/grafana:latest volumes: - ./hack/grafana.ini:/etc/grafana/grafana.ini - ./hack/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yaml environment: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin - GF_AUTH_DISABLE_LOGIN_FORM=true ports: - target: 3000 published: 8081 protocol: tcp mode: host labels: - "traefik.enable=false" jaeger: image: jaegertracing/all-in-one:1.58.0 volumes: - "./hack/jaeger-ui.json:/etc/jaeger/jaeger-ui.json" command: --query.ui-config /etc/jaeger/jaeger-ui.json environment: - METRICS_STORAGE_TYPE=prometheus - PROMETHEUS_SERVER_URL=http://prometheus:9090 - PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR=${PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR:-true} - PROMETHEUS_QUERY_NAMESPACE=${PROMETHEUS_QUERY_NAMESPACE:-} - PROMETHEUS_QUERY_DURATION_UNIT=${PROMETHEUS_QUERY_DURATION_UNIT:-} - PROMETHEUS_QUERY_NORMALIZE_CALLS=true - PROMETHEUS_QUERY_NORMALIZE_DURATION=true ports: - target: 16686 published: 8082 protocol: tcp mode: host labels: - "traefik.enable=false" volumes: prom_data: