# docker-compose.yml
version: "3.8"
services:
  frontend:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - ./NFT-Minter:/app
      - /app/node_modules
    networks:
      - traefik-proxy
    labels:
      - traefik.enable=true
      - traefik.http.routers.nft-hotreload${USER_ID:-1}.rule=Host(`${URL_NFT_HOTRELOAD}`) 
      - traefik.http.routers.nft-hotreload${USER_ID:-1}.entrypoints=websecure
      - traefik.http.routers.nft-hotreload${USER_ID:-1}.tls=true
      - traefik.http.routers.nft-hotreload${USER_ID:-1}.tls.certresolver=lets-encrypt
      - traefik.http.services.nft-hotreload${USER_ID:-1}.loadbalancer.server.port=3000
      - traefik.docker.network=${NETWORK_TRAEFIK}
    environment:
      - CHOKIDAR_USEPOLLING=true

  filebrowser:
    image: filebrowser/filebrowser:latest
    volumes:
      - ./NFT-Minter:/srv
    labels:
      - traefik.enable=true
      - traefik.http.routers.filebrowser-nft-hotreloa${USER_ID:-1}.rule=Host(`file.${URL_NFT_HOTRELOAD}`)
      - traefik.http.routers.filebrowser-nft-hotreloa${USER_ID:-1}.entrypoints=websecure
      - traefik.http.routers.filebrowser-nft-hotreloa${USER_ID:-1}.tls=true
      - traefik.http.routers.filebrowser-nft-hotreloa${USER_ID:-1}.tls.certresolver=lets-encrypt
      - traefik.http.services.filebrowser-nft-hotreloa${USER_ID:-1}.loadbalancer.server.port=80
      - traefik.docker.network=${NETWORK_TRAEFIK}
    networks:
      - traefik-proxy

networks:
    traefik-proxy:
      external:
        name: ${NETWORK_TRAEFIK}
          