Files
ylst-h5/docker/Dockerfile
陈昱达 44bf17d47b feat(docker): 添加自定义 nginx 配置并调整反向代理设置
- 添加自定义 nginx配置文件,用于反向代理到伊利 GPT
- 修改 Dockerfile,使用新的 nginx 配置
- 更新前端代码,将主机地址改为当前窗口地址
2025-05-27 20:47:53 +08:00

20 lines
781 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM yldc-docker.pkg.coding.yili.com/pubrepo/pubdocker/nginx:latest
# ---------------------只改此处,其它不动--------------------------
# 定义构建物目录 当前目录 ./ 为代码根目录
# ARG DIST_DIR=./dist
ARG DIST_DIR=./dist
# 定义目标相对目录访问url即为: /${URL_DIR}/index.html
ARG URL_DIR=
# ----------------------------------------------------------------
COPY ${DIST_DIR} /var/www/html/${URL_DIR}
# VUE history路由模式释放此行(无需更改内容)以更改nginx conf 的 try_files路径
RUN sed -i "s/\ \/index.html/\ \/${URL_DIR}\/index.html/g" /etc/nginx/conf.d/default.conf
# 默认不建议使用自定义nginx配置如必须使用请提前沟通
COPY ./docker/nginx.conf /etc/nginx/conf.d/nginx.conf
EXPOSE 80