Skip to content

dprosper/cidr-calculator

Repository files navigation

This version is scaled down and removes all dependencies of running with a backend service, i.e. it can run on Github pages. The old version is still availabe under the v1 branch.

calculator

Run on Code Engine

  1. Target your desired region.
  ibmcloud target -r us-east -g default
  1. Create the Code Engine project.
  ibmcloud code-engine project create --name calculator
  1. Create the application from an existing container image, expose port 3000.
  ibmcloud code-engine app create -n calculator \
  --image docker.io/dprosper/calculator \
  --port 3000

Build and run locally

Build image

  docker build -t dprosper/ic-cidr-calculator -f Dockerfile .
  docker buildx build --platform=linux/amd64 --load -t dprosper/ic-cidr-calculator -f Dockerfile .
  docker buildx build --platform=linux/amd64 -t local-build --load .

Run local

  docker run --rm -p 3000:3000 dprosper/ic-cidr-calculator

Build and run on Pull Request

Submit a pull request and the code will be deployed to Code Engine to facilitate the review.

Deploy Github pages

  npm run deploy