services:
  mongo:
    image: mongo:6
    container_name: quizcms-mongo
    ports:
      - "27017:27017"
    volumes:
      - mongo_data:/data/db
    restart: unless-stopped
  api:
    build: .
    container_name: quizcms-api
    ports:
      - "3003:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      - MONGODB_URI=mongodb://mongo:27017/quizcms
      - JWT_SECRET=change_me
      #- CORS_ORIGINS=http://localhost:5173,http://localhost:3000,http://localhost:3003
      - CORS_ORIGINS=https://quiz-cms.convertingoffers.link,https://convertingoffers.link,https://www.convertingoffers.link
      - RATE_LIMIT_WINDOW_MS=60000
      - RATE_LIMIT_MAX=120
      - RATE_LIMIT_SUBMIT_WINDOW_MS=60000
      - RATE_LIMIT_SUBMIT_MAX=20
      - LOG_LEVEL=info
      - TRUST_PROXY=1
      - TRUST_PROXY=10.0.0.0/8
        #Only deployed
      - PUBLIC_BASE_PATH=/api/quiz
    depends_on:
      - mongo
    restart: unless-stopped
volumes:
  mongo_data:
