mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-11 23:45:11 +08:00
- 引入多阶段构建,分离构建与运行时环境 - 使用node:20-alpine作为构建基础镜像,减小体积 - 添加pnpm包管理器并优化依赖安装流程 - 利用缓存机制提升构建效率 - 新增nginx.conf配置文件解决Vue Router历史模式404问题 - 设置静态资源缓存策略提升性能 - 更改默认启动命令为Nginx服务方式运行应用 - 移除开发服务器相关指令,适配生产部署需求
17 lines
367 B
Nginx Configuration File
17 lines
367 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html index.htm;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# 可选:缓存静态资源
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|ttf|eot) {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
} |