This commit is contained in:
longdayi 2025-03-04 22:15:34 +08:00
parent 4f7bb01e86
commit 8be58c2f10
4 changed files with 31 additions and 35 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@ backup
# dependencies
**/node_modules/
volumes
web-dist
/.pnp
.pnp.js
*.tar

View File

@ -108,21 +108,15 @@ CMD ["/usr/bin/entrypoint.sh"]
# 使用 Nginx 的 Alpine 版本作为基础镜像
FROM nginx:stable-alpine as nginx
# 替换 Alpine 的软件源为阿里云镜像
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 设置工作目录
WORKDIR /usr/share/nginx/html
# 设置环境变量
ENV NODE_ENV production
# 安装 envsubst 和 inotify-tools
RUN apk add --no-cache gettext inotify-tools
# 创建 /data/uploads 目录
RUN mkdir -p /data/uploads
# 暴露 80 端口
EXPOSE 80

View File

@ -7,12 +7,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script>
window.env = {
VITE_APP_SERVER_IP: "$VITE_APP_SERVER_IP",
VITE_APP_APP_NAME: "$VITE_APP_APP_NAME",
VITE_APP_VERSION: "$VITE_APP_VERSION",
VITE_APP_SERVER_IP: "$SERVER_IP",
VITE_APP_SERVER_IP: "$SERVER_PORT",
VITE_APP_APP_NAME: "$APP_NAME",
VITE_APP_VERSION: "$VERSION",
VITE_APP_FILE_PORT: "$FILE_PORT",
};
</script>
<title>%VITE_APP_APP_NAME%</title>
<title>$APP_NAME</title>
</head>
<body>

View File

@ -1,27 +1,26 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script>
window.env = {
VITE_APP_SERVER_IP: "192.168.139.239",
VITE_APP_SERVER_PORT: "3006",
VITE_APP_FILE_PORT: "8092",
VITE_APP_VERSION: "0.3.0",
VITE_APP_APP_NAME: "烽火慕课",
VITE_APP_SERVER_IP: "$SERVER_IP",
VITE_APP_SERVER_PORT: "$SERVER_PORT",
VITE_APP_FILE_PORT: "$FILE_PORT",
VITE_APP_VERSION: "$VERSION",
VITE_APP_APP_NAME: "$APP_NAME",
};
</script>
<title>fhmooc</title>
<script
type="module"
crossorigin
src="/assets/index-De5TXRhh.js"></script>
<title>$APP_NAME</title>
<script type="module" crossorigin src="/assets/index-De5TXRhh.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BL-ZztvJ.css" />
</head>
<body>
<div id="root"></div>
</body>
</html>