services:

  calc:
    image: audreyt/ethercalc
    container_name: ${ethercalcServName}
    # ports:
    #   - 8082:8000
    networks:
      - ethercalcNet
    env_file:
      - ../../secret/env-${ethercalcServName}
    links:
      - redis:redis
    restart: ${restartPolicy}
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.${ethercalcServName}.rule=Host(`${calcHost}.${domain}`)"

  redis:
    image: redis
    container_name: ${ethercalcDBName}
    networks:
      - ethercalcNet
    volumes:
      - calcDB:/data
    command: redis-server --appendonly yes
    restart: ${restartPolicy}
    #on autorise 40% du cpu car sinon les docs mettent un temps fou à charger
    cpus: 0.4

volumes:
  calcDB:

networks:
  ethercalcNet:
    external: true
    name: ethercalcNet
