Compare commits

...

3 Commits

Author SHA1 Message Date
tangxinyue 8bab17d01e fix: 配置 vite.config.js 忽略 UNRESOLVED_IMPORT 告警防止容器构建中断 2026-07-24 15:02:05 +08:00
tangxinyue 9c5322b142 解决Dockerfile报错 2026-07-24 14:55:32 +08:00
tangxinyue 9a1405743b 部署Dockerfile 2026-07-24 14:44:57 +08:00
4 changed files with 30 additions and 0 deletions

3
.gitignore vendored
View File

@ -17,6 +17,9 @@ npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
pnpm-debug.log* pnpm-debug.log*
log/
/log
# 编辑器配置 # 编辑器配置
.vscode/* .vscode/*

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM registry.cn-shanghai.aliyuncs.com/devcon/node:18
ARG PACKAGE
ENV PACKAGE $PACKAGE
ADD . /app
WORKDIR /app
RUN mkdir -p /app/log
RUN cd /app && \
chmod +x start.sh && \
npm config set registry https://registry.npmmirror.com/ && \
npm config set "@batiao:registry" https://maven.batiao8.com/repository/npm-releases/ && \
npm install && \
npm run build
EXPOSE 9270
CMD [ "/app/start.sh" ]

4
start.sh Normal file
View File

@ -0,0 +1,4 @@
cd /app
while [ true ];do
nohup npm run start
done

View File

@ -17,6 +17,15 @@ export default defineConfig({
'@': resolve(__dirname, 'src') '@': resolve(__dirname, 'src')
} }
}, },
build: {
chunkSizeWarningLimit: 2000,
rollupOptions: {
onwarn(warning, warn) {
if (warning.code === 'UNRESOLVED_IMPORT' || warning.code === 'UNUSED_EXTERNAL_IMPORT') return;
warn(warning);
}
}
},
server: { server: {
//通过电脑ip访问设置 //通过电脑ip访问设置
host: '0.0.0.0', host: '0.0.0.0',