fix: start nginx without resolving A-site at boot [deploy]
This commit is contained in:
1 parent
9d5ea0b393
commit
5dc62bd7c4
4 files changed
+47
-11
No files matched your search
+5
-4
@@ -1,12 +1,13 @@
|
||||
# CI 中先 pnpm build 产出 dist/;运行时由 nginx 托管,并把 /embed /images /api/contact 反代到 A 站
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
# 集群内 A 站地址,可被 K8s env 覆盖
|
||||
ENV A_UPSTREAM=http://project57-deploy.ns-project57.svc.cluster.local:3000
|
||||
# 只替换 A_UPSTREAM,避免 envsubst 把 nginx 的 $host/$uri 等变量清空导致容器起不来
|
||||
ENV NGINX_ENVSUBST_FILTER=A_UPSTREAM
|
||||
|
||||
COPY nginx.conf /etc/nginx/templates/default.conf.template
|
||||
# 不走 templates/envsubst,避免把 nginx 的 $host/$uri 清空
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY docker-entrypoint.d/40-a-upstream.sh /docker-entrypoint.d/40-a-upstream.sh
|
||||
RUN sed -i 's/\r$//' /docker-entrypoint.d/40-a-upstream.sh \
|
||||
&& chmod 0755 /docker-entrypoint.d/40-a-upstream.sh
|
||||
COPY dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 3000
|
||||
Reference in new issue
Block a user