Running the application locally with Docker

If your system has a different version of Node.js, you can run the application locally in a Docker container.

To run the application locally with Docker, complete the following steps:

  1. Export the function app configuration as environment variables:

    ./cli.sh functions-settings > local.settings.json
    
  2. Either Authenticate against the Google Container registry or build the Docker image using the following command:

    docker build -t ghcr.io/nordicsemiconductor/asset-tracker-cloud-azure-js .
    
  3. Run the function app by using the following command:

    docker run --rm --net=host -P \
        -v ${PWD}:/workdir ghcr.io/nordicsemiconductor/asset-tracker-cloud-azure-js \
        func start \
        --functions `find ./ -type f -name function.json | grep -v mock-http-api | xargs dirname | tr './\n' ' '`
    

You can now use http://localhost:7071/ as your REACT_APP_AZURE_API_ENDPOINT for the app.