services:
    app:
        build:
            context: .
            dockerfile: Dockerfile
        container_name: lst_app
        ports:
            #- "${VITE_PORT:-4200}:4200"
            - "4000:4200"
        environment:
            - NODE_ENV=devolpment
            - DATABASE_HOST=host.docker.internal
            - DATABASE_PORT=${DATABASE_PORT}
            - DATABASE_USER=${DATABASE_USER}
            - DATABASE_PASSWORD=${DATABASE_PASSWORD}
            - DATABASE_DB=${DATABASE_DB}
            - PROD_SERVER=${PROD_SERVER}
            - PROD_PLANT_TOKEN=${PROD_PLANT_TOKEN}
            - PROD_USER=${PROD_USER}
            - PROD_PASSWORD=${PROD_PASSWORD}
            - BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
            - BETTER_AUTH_URL=${BETTER_AUTH_URL}
        restart: unless-stopped
        # for all host including prod servers, plc's, printers, or other de
        extra_hosts:
            - "${PROD_SERVER}:${PROD_IP}"

        networks:
            - default
            - logisticsNetwork
            - mlan1
networks:
    logisticsNetwork:
        driver: macvlan
        driver_opts:
            parent: eth0
        ipam:
            config:
                - subnet: ${LOGISTICS_NETWORK}
                  gateway: ${LOGISTICS_GATEWAY}

    mlan1:
        driver: macvlan
        driver_opts:
            parent: eth0
        ipam:
            config:
                - subnet: ${MLAN1_NETWORK}
                  gateway: ${MLAN1_GATEWAY}
