From 4621d6230114dfaa91feecb0c22d8bb35d67b105 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Fri, 31 Jul 2026 12:24:01 +0800 Subject: [PATCH] feat: add nginx entrypoint --- scripts/nginx-entrypoint.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/nginx-entrypoint.sh diff --git a/scripts/nginx-entrypoint.sh b/scripts/nginx-entrypoint.sh new file mode 100755 index 0000000..b563aa1 --- /dev/null +++ b/scripts/nginx-entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# nginx entrypoint for the model-platform gateway. +# +# Overrides the default nginx:alpine /docker-entrypoint.sh to render the +# templated default.conf (mounted at /etc/nginx/conf.d/default.conf.template) +# by substituting the single ${RUSTFS_ENDPOINT} placeholder, then writes +# the result to /etc/nginx/conf.d/default.conf and execs the CMD +# (typically `nginx -g 'daemon off;'`). +# +# Uses sed (busybox-safe) so no extra packages are needed. + +set -eu + +: "${RUSTFS_ENDPOINT:=http://rustfs:9000}" + +sed \ + -e "s|\${RUSTFS_ENDPOINT}|${RUSTFS_ENDPOINT}|g" \ + /etc/nginx/conf.d/default.conf.template \ + > /etc/nginx/conf.d/default.conf + +exec "$@"