This example demonstrates how to build a docker image running Node.js with the Akamai Edgegrid dependency installed.
Keyword(s): edgegrid, node, docker
This demo also contains a very small Node.js project (list-network-lists.js) which lists all the Network Lists available by leveraging the List Network Lists GET API call
- Basic Docker knowledge
- Basic Node.js projects knowledge
- Akamai API credentials and .edgerc file
-
Clone this repository locally
-
Build the Docker image
$ docker build --tag edgegrid-node:latest .
For this image I'm using the node 15.14.0 image based on alpine3.0. When the build process executes the npm install --production
command it will install all the depencies specified in the `package.json' file.
- Start the container, allow read-only access to the local
.edgerc
file and run the app:npm start
.
$ docker run -it --rm --name edgegrid-node -v $HOME/.edgerc:/root/.edgerc:ro edgegrid-node:latest npm start
In our package.json
the start script is node list-network-lists.js