增加脚本,支持docker环境变量的方式传入服务端接口地址

This commit is contained in:
2025-09-08 09:49:51 +08:00
parent 081eb910eb
commit ae8e8e7e8f
2 changed files with 56 additions and 1 deletions
+13 -1
View File
@@ -2,6 +2,10 @@ FROM nginx
MAINTAINER jeecgos@163.com
VOLUME /tmp
ENV LANG en_US.UTF-8
ENV VITE_GLOB_API_URL https://api.xjygjk.com
ENV VITE_GLOB_DOMAIN_URL https://api.xjygjk.com
RUN echo "server { \
#解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 \
location / { \
@@ -18,4 +22,12 @@ RUN echo "server { \
&& mkdir -p /var/www/html
ADD dist/ /var/www/html/
EXPOSE 3100
# 添加运行时注入脚本
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# 启动脚本
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 80