redis.yml - excelbd/Excel-ERP-Production-Setup GitHub Wiki

version: "3.7"

services:
  redis:
    image: redis:6.0
    ports:
      - 6379:6379
    networks: 
      - rma-network 
  redis-commander:
    container_name: redis-commander
    hostname: redis-commander
    image: ghcr.io/joeferner/redis-commander:latest
    environment:
      - REDIS_HOSTS=local:redis:6379
    ports:
      - "8081:8081"  
    networks: 
      - rma-network 

  rma-frontend:
    image: excelazmin/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
      - rma-network
    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: excelazmin/rma_warranty:${RMA_WARRANTY_VERSION?Variable RMA_WARRANTY_VERSION not set}
    environment:
      - API_HOST=rma-server
      - API_PORT=8800
    networks:
      - mongodb-network
      - traefik-public
      - rma-network
    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: excelazmin/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
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - CACHE_TTL=${CACHE_TTL}

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