RMA SERVER Stack yml - excelbd/Excel-ERP-Production-Setup GitHub Wiki

version: "3.7"

services:
  rma-frontend:
    image: registry.gitlab.com/castlecraft/excel-rma/rma-frontend:${RMA_FRONTEND_VERSION?Variable RMA_FRONTEND_VERSION not set}
    environment:
      - API_HOST=rma-server
      - API_PORT=8800
    healthcheck:
      test: (echo >/dev/tcp/rma-server/8800) &>/dev/null && exit 0 || exit 1
      interval: 1s
      retries: 15
    networks:
      - mongodb-network
      - traefik-public
    deploy:
      restart_policy:
        condition: on-failure
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=traefik-public"
        - "traefik.constraint-label=traefik-public"
        - "traefik.http.routers.rma-frontend.rule=Host(`${SITE?Variable SITE not set}`)"
        - "traefik.http.routers.rma-frontend.entrypoints=http"
        - "traefik.http.routers.rma-frontend.middlewares=https-redirect"
        - "traefik.http.middlewares.rma-frontend.headers.contentTypeNosniff=true"
        - "traefik.http.routers.rma-frontend-https.rule=Host(`${SITE?Variable SITE not set}`)"
        - "traefik.http.routers.rma-frontend-https.entrypoints=https"
        - "traefik.http.routers.rma-frontend-https.tls=true"
        - "traefik.http.routers.rma-frontend-https.tls.certresolver=le"
        - "traefik.http.services.rma-frontend.loadbalancer.server.port=8080"

  rma-warranty:
    image: registry.gitlab.com/castlecraft/excel-rma/rma-warranty:${RMA_WARRANTY_VERSION?Variable RMA_WARRANTY_VERSION not set}
    environment:
      - API_HOST=rma-server
      - API_PORT=8800
    networks:
      - mongodb-network
      - traefik-public
    deploy:
      restart_policy:
        condition: on-failure
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=traefik-public"
        - "traefik.constraint-label=traefik-public"
        - "traefik.http.routers.rma-warranty.rule=Host(`${WARRANTY_SITE?Variable WARRANTY_SITE not set}`)"
        - "traefik.http.routers.rma-warranty.entrypoints=http"
        - "traefik.http.routers.rma-warranty.middlewares=https-redirect"
        - "traefik.http.middlewares.rma-warranty.headers.contentTypeNosniff=true"
        - "traefik.http.routers.rma-warranty-https.rule=Host(`${WARRANTY_SITE?Variable WARRANTY_SITE not set}`)"
        - "traefik.http.routers.rma-warranty-https.entrypoints=https"
        - "traefik.http.routers.rma-warranty-https.tls=true"
        - "traefik.http.routers.rma-warranty-https.tls.certresolver=le"
        - "traefik.http.services.rma-warranty.loadbalancer.server.port=8080"

  rma-server:
    image: registry.gitlab.com/castlecraft/excel-rma/rma-server:${RMA_SERVER_VERSION?Variable RMA_SERVER_VERSION not set}
    deploy:
      restart_policy:
        condition: on-failure
    healthcheck:
      test: (echo >/dev/tcp/rma-server/8800) &>/dev/null && exit 0 || exit 1
      interval: 1s
      retries: 15
    environment:
      - DB_HOST=global-mongodb
      - DB_NAME=${SERVER_DB}
      - DB_PASSWORD=${SERVER_DB_PASSWORD}
      - DB_USER=${SERVER_USER}
      - CACHE_DB_NAME=${CACHE_DB}
      - CACHE_DB_PASSWORD=${CACHE_DB_PASSWORD}
      - CACHE_DB_USER=${CACHE_USER}
      - NODE_ENV=production
      - NODE_OPTIONS=--max-old-space-size=4096
      - AGENDA_JOBS_CONCURRENCY=1
    networks:
      - mongodb-network

networks:
  traefik-public:
    external: true
  mongodb-network:
    external: true