Docker: image optimizations

Docker Image Size reduced by 80% (from 447 MB to 89.4 MB and ~15 seconds faster builds)

Optimization changes Made:

  1. Added .dockerignore
    1. Excludes unnecessary files from build context
  2. Pinned Alpine version to 3.19
    1. The same Alpine version ensures consistent results across builds.
    2. The version can be updated as and when required.
  3. Combine apk add commands into single layer
    1. Reduces image layers and size
  4. Multi-stage build separating builder and runtime stages
    1. Smaller final image
    2. More secure as only runtime dependencies included in the final image
    3. Easier debugging and better build caching
  5. git submodules for vendor dependencies

Other changes: bin/compile and support for new environment variables

Closes: #34 (closed)

Merge request reports

Loading