117 lines
5.1 KiB
YAML
117 lines
5.1 KiB
YAML
services:
|
|
klz-app:
|
|
image: registry.infra.mintel.me/mintel/klz-cables.com:${IMAGE_TAG:-latest}
|
|
restart: always
|
|
networks:
|
|
- default
|
|
- infra
|
|
env_file:
|
|
- ${ENV_FILE:-.env}
|
|
labels:
|
|
- "traefik.enable=true"
|
|
# HTTP ⇒ HTTPS redirect
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-web.rule=${TRAEFIK_HOST_RULE:-Host(`klz-cables.com`)}"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-web.entrypoints=web"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-web.middlewares=redirect-https"
|
|
# HTTPS router (Standard)
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}.rule=${TRAEFIK_HOST_RULE:-Host(`klz-cables.com`)}"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}.entrypoints=websecure"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}.tls.certresolver=le"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}.tls=true"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}.service=${PROJECT_NAME:-klz-cables}"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}.middlewares=${TRAEFIK_MIDDLEWARES:-${PROJECT_NAME:-klz-cables}-ratelimit,${PROJECT_NAME:-klz-cables}-forward,${PROJECT_NAME:-klz-cables}-compress}"
|
|
|
|
# HTTPS router (Unprotected - for Analytics & Errors)
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-unprotected.rule=${TRAEFIK_HOST_RULE:-Host(`klz-cables.com`)} && PathPrefix(`/stats`, `/errors`)"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-unprotected.entrypoints=websecure"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-unprotected.tls.certresolver=le"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-unprotected.tls=true"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-unprotected.service=${PROJECT_NAME:-klz-cables}"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-unprotected.middlewares=${PROJECT_NAME:-klz-cables}-ratelimit,${PROJECT_NAME:-klz-cables}-forward,${PROJECT_NAME:-klz-cables}-compress"
|
|
|
|
- "traefik.http.services.${PROJECT_NAME:-klz-cables}.loadbalancer.server.port=3000"
|
|
- "traefik.http.services.${PROJECT_NAME:-klz-cables}.loadbalancer.server.scheme=http"
|
|
- "traefik.docker.network=infra"
|
|
|
|
# Middleware Definitions
|
|
- "traefik.http.middlewares.${PROJECT_NAME:-klz-cables}-compress.compress=true"
|
|
|
|
# Forwarded Headers
|
|
- "traefik.http.middlewares.${PROJECT_NAME:-klz-cables}-forward.headers.customrequestheaders.X-Forwarded-Proto=https"
|
|
- "traefik.http.middlewares.${PROJECT_NAME:-klz-cables}-forward.headers.customrequestheaders.X-Forwarded-Ssl=on"
|
|
|
|
# Middleware Definitions
|
|
- "traefik.http.middlewares.${PROJECT_NAME:-klz-cables}-ratelimit.ratelimit.average=100"
|
|
- "traefik.http.middlewares.${PROJECT_NAME:-klz-cables}-ratelimit.ratelimit.burst=50"
|
|
healthcheck:
|
|
test: [ "CMD", "curl", "-f", "http://127.0.0.1:3000/" ]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
directus:
|
|
image: directus/directus:11
|
|
restart: always
|
|
networks:
|
|
default:
|
|
infra:
|
|
aliases:
|
|
- ${PROJECT_NAME:-klz-cables}-directus
|
|
env_file:
|
|
- ${ENV_FILE:-.env}
|
|
environment:
|
|
KEY: ${DIRECTUS_KEY}
|
|
SECRET: ${DIRECTUS_SECRET}
|
|
ADMIN_EMAIL: ${DIRECTUS_ADMIN_EMAIL}
|
|
ADMIN_PASSWORD: ${DIRECTUS_ADMIN_PASSWORD}
|
|
DB_CLIENT: 'pg'
|
|
DB_HOST: 'directus-db'
|
|
DB_PORT: '5432'
|
|
DB_DATABASE: ${DIRECTUS_DB_NAME:-directus}
|
|
DB_USER: ${DIRECTUS_DB_USER:-directus}
|
|
DB_PASSWORD: ${DIRECTUS_DB_PASSWORD:-directus}
|
|
WEBSOCKETS_ENABLED: 'true'
|
|
PUBLIC_URL: ${DIRECTUS_URL:-https://cms.klz-cables.com}
|
|
# Error Tracking
|
|
SENTRY_DSN: ${SENTRY_DSN}
|
|
SENTRY_ENVIRONMENT: ${TARGET:-development}
|
|
LOGGER_LEVEL: ${LOG_LEVEL:-info}
|
|
volumes:
|
|
- ./directus/uploads:/directus/uploads
|
|
- ./directus/extensions:/directus/extensions
|
|
- ./directus/schema:/directus/schema
|
|
- ./directus/migrations:/directus/migrations
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-directus.rule=Host(`${DIRECTUS_HOST}`)"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-directus.entrypoints=websecure"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-directus.tls.certresolver=le"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-directus.tls=true"
|
|
- "traefik.http.routers.${PROJECT_NAME:-klz-cables}-directus.middlewares=${PROJECT_NAME:-klz-cables}-forward,compress"
|
|
- "traefik.http.services.${PROJECT_NAME:-klz-cables}-directus.loadbalancer.server.port=8055"
|
|
- "traefik.docker.network=infra"
|
|
|
|
directus-db:
|
|
image: postgres:15-alpine
|
|
restart: always
|
|
networks:
|
|
- default
|
|
env_file:
|
|
- ${ENV_FILE:-.env}
|
|
environment:
|
|
POSTGRES_DB: ${DIRECTUS_DB_NAME:-directus}
|
|
POSTGRES_USER: ${DIRECTUS_DB_USER:-directus}
|
|
POSTGRES_PASSWORD: ${DIRECTUS_DB_PASSWORD:-directus}
|
|
volumes:
|
|
- directus-db-data:/var/lib/postgresql/data
|
|
|
|
networks:
|
|
default:
|
|
name: ${PROJECT_NAME:-klz-cables}-internal
|
|
infra:
|
|
external: true
|
|
|
|
volumes:
|
|
directus-db-data:
|