Wednesday, April 27, 2022

DEVSECOPS: Docker Level 2


Reference: https://www.youtube.com/c/TechnoDine/videos

  • NodeJS web app
  • Dockerfile
  • Including Outside files into the base image FS snapshot
  • Port Networking
  • Dockerfile with build cache

NodeJS webapp 1 - package.json (Configuration for the Web Server)

package.json (when npm install is run in Dockerfile later, it will find this file (can say similar to yaml) ).


NodeJS webapp 2 - index.js (Web Server Logic)


index.js is server logic (express is a library and it is the dependency stated from package.json)



Understanding Dockerfile:

 


 Including File into the Base Image FS Snapshot (COPY):


Port Forwarding:






Dockerfile with Build Cache:


docker build Cache (COPY only the configuration, not the server logic as the logic may change)
it is important to only copy the necessary files (bare minimum) to allow reduction of running time.
it does make a difference, the order of the commands in Dockerfile.

No comments:

Post a Comment

Fluentd

Open-source log data collector > why logs? - for compliance (auditing, company, business) - for security (transparency, monitoring, admin...