From b30f369ca35e35ede590b8a338b3c6636631e3eb Mon Sep 17 00:00:00 2001 From: wizardchen Date: Thu, 6 Aug 2026 21:17:15 +0800 Subject: [PATCH] feat(docker): add custom entrypoint script and update Dockerfile Introduce a new entrypoint script for the Nginx container to ensure proper startup behavior. Update the Dockerfile to use a stable-alpine Nginx base image and include the entrypoint script, enhancing the deployment process for the documentation site. --- website-docs/Dockerfile | 13 +++++++++---- website-docs/docker-entrypoint.sh | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 website-docs/docker-entrypoint.sh diff --git a/website-docs/Dockerfile b/website-docs/Dockerfile index 3282ccd4..cccbf724 100644 --- a/website-docs/Dockerfile +++ b/website-docs/Dockerfile @@ -1,5 +1,5 @@ # Build from repository root: -# docker build -f website-docs/Dockerfile -t wechatopenai/weknora-docs:latest . +# docker build --platform linux/amd64 -f website-docs/Dockerfile -t wechatopenai/weknora-docs:latest . # # Gateway (preserve /docs/ prefix): # location /docs/ { proxy_pass http://weknora-docs:80/docs/; } @@ -21,12 +21,17 @@ RUN cd website-docs && npm ci COPY website-docs/ website-docs/ RUN cd website-docs && npm run build -# Same pinned nginx base as frontend/Dockerfile (CentOS 7 / old libseccomp compatible). -FROM nginx:1.30.3-alpine@sha256:0d3b80406a13a767339fbe2f41406d6c7da727ab89cf8fae399e81f780f814d1 +# Align with internal frontend image: stable-alpine + custom entrypoint + bash. +FROM nginx:stable-alpine AS production-stage COPY --from=builder /build/website-docs/.vitepress/dist /usr/share/nginx/html + +RUN apk add --no-cache bash + COPY website-docs/nginx.conf /etc/nginx/conf.d/default.conf +COPY website-docs/docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x /docker-entrypoint.sh EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/website-docs/docker-entrypoint.sh b/website-docs/docker-entrypoint.sh new file mode 100644 index 00000000..911d7022 --- /dev/null +++ b/website-docs/docker-entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +exec nginx -g 'daemon off;'