Skip to content

fix: support mounted .env files in container deployments#1196

Merged
Bushstar merged 2 commits into
mainfrom
bush/env
Apr 13, 2026
Merged

fix: support mounted .env files in container deployments#1196
Bushstar merged 2 commits into
mainfrom
bush/env

Conversation

@Bushstar

Copy link
Copy Markdown
Contributor

Summary

  • add a shared env loader for MDIP services
  • support mounted .env files in containers without requiring a custom entrypoint.sh
  • support KC_ENV_FILE for env files mounted at non-default paths
  • keep existing ./start-node and direct environment injection behavior unchanged
  • document the supported deployment patterns for Docker Compose and Kubernetes

Problem

Local startup works because ./start-node sources the repo root .env and docker compose injects the resolved values into each container.

In standalone container deployments such as Kubernetes, operators may mount a .env file into the container, but the service does not automatically load that file unless they add a wrapper script to source and export it first.

Solution

This PR adds a shared env-loading utility in @mdip/common and updates the runtime services to use it at startup.

The loader now supports the following configuration patterns:

  • direct env injection via env / envFrom
  • a mounted .env file at /app/.env
  • a mounted env file at any path referenced by KC_ENV_FILE

The loader preserves existing behavior by not overriding variables already present in process.env.

@Bushstar Bushstar requested a review from Edgeman-SelfID April 13, 2026 12:17
@Bushstar Bushstar merged commit 0d2866c into main Apr 13, 2026
17 checks passed
@Bushstar Bushstar deleted the bush/env branch April 13, 2026 14:55
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.

Support mounted .env files in container deployments without custom entrypoint scripts

2 participants