返回 Skill 列表
extension
分类: 开发与工程无需 API Key

entrypoint

为Docker容器运行时环境变量注入生成entrypoint.sh脚本。在容器启动时,用实际的环境变量替换构建资产中的占位符值。

person作者: jakexiaohubgithub

Entrypoint Script Skill

Purpose

Generate entrypoint.sh script for Docker container runtime environment variable injection.

Output

Create the file: entrypoint.sh in the root directory

Example File

See: examples.md in this directory for complete examples and detailed explanations.

Conditional Logic

JS Environment Substitution

  • If application_type: "standalone" → Include the for loop that processes app*.js files with envsubst
  • If application_type: "micro-frontend" → Omit the for loop (launcher handles environment injection)

Note: The {{JS_ENV_SUBSTITUTION}} placeholder in the template should be replaced with the actual for loop code or removed based on application_type.

Notes

  • Enables runtime environment variable injection into built assets
  • Uses envsubst to replace placeholders with actual environment variable values
  • Always processes index.html for VITE_CONTEXT_PATH
  • Conditionally processes JavaScript files for standalone apps only
  • Sets errexit and nounset for safer script execution
  • Starts nginx in foreground mode for Docker container
  • Requires gettext-base package for envsubst command
  • Must be executable (chmod +x entrypoint.sh)