fix: 修复后端启动脚本

This commit is contained in:
CaasianVale
2025-03-07 15:30:24 +08:00
parent d1feaef434
commit a567925bbc
3 changed files with 10 additions and 8 deletions

View File

@@ -26,10 +26,10 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf.template
COPY --from=build-stage /app/dist /usr/share/nginx/html
# 创建启动脚本
RUN echo '#!/bin/sh \n\
envsubst "\$BACKEND_URL" < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf \n\
nginx -g "daemon off;"' > /docker-entrypoint.sh && \
chmod +x /docker-entrypoint.sh
RUN echo '#!/bin/sh' > /docker-entrypoint.sh && \
echo 'envsubst "$BACKEND_URL" < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf' >> /docker-entrypoint.sh && \
echo 'nginx -g "daemon off;"' >> /docker-entrypoint.sh && \
chmod +x /docker-entrypoint.sh
# 暴露80端口
EXPOSE 80