Skip to content

feat: support podman/docker containerization#2

Open
tomdavidson wants to merge 2 commits intoeladcandroid:mainfrom
tomdavidson:main
Open

feat: support podman/docker containerization#2
tomdavidson wants to merge 2 commits intoeladcandroid:mainfrom
tomdavidson:main

Conversation

@tomdavidson
Copy link
Copy Markdown

Overview

This pull request introduces comprehensive containerization support for the YAMCP-UI application, enabling it to be built and run as a secure, minimal OCI-compliant container.

The PR attempts minimal change to existing code but some changes were neccesary:

  • SIGINT and SIGTERM signal handling
  • Move non-prod deps to dev dep in package.json
  • Does not modify the existing vite build but adds bundling the server code.
  • Binds server to 0.0.0.0 rather than localhost

Build the container:

./scripts/container.sh build

Run the production container:

podman run -it --rm \
  -p 8765:8765 \
  -v "${XDG_CONFIG_HOME:-$HOME/.config}/yamcp:/home/nonroot/.config/yamcp" \
  -v "${XDG_DATA_HOME:-$HOME/.local/share}/yamcp:/home/nonroot/.local/share/yamcp" \
  yamcp-ui:latest

Introduces a multi-stage Dockerfile to create a minimal, secure production container for the YAMCP-UI application:

- Distroless Node.js 20 image for minimal size & a reduced attack surface.
- Bundle server for minimal size (with Express handling).
- Graceful shutdown with `SIGINT` and `SIGTERM` signals.
- Moved non-prod deps to dev dependencies to reduce container size by ~400mb.
- Container build script that auto-labels container from package.json & git meta data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant