- Install latest version of Node.js
- Install pnpm
- Run
pnpm install
to install dependencies - Run
npm run dev
to run the API server
- Install Docker
- Install ngrok
- Run
cd image-scanner
- Run
docker-compose up -d
- Now the web service is running on port 3000. Expose it to the internet using ngrok:
ngrok http 3000
- Run
cd ..
- Change the IMAGE_SCANNING_URL entry in
.env
to the URL provided by ngrok - Restart the application:
CTRL+C
on the terminal that is runningnpm run dev
and then runnpm run dev
again - Testing the function: Upon creating artifact, you should see a message in the terminal running
npm run dev
that says "Image scanning triggered for artifact: (artifact name)". After the scanning finishes, the terminal will log out a POST /webhook request. Check the "Vulnerabilities" tab in the application to see the results.