mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
feat(docker): 优化Docker构建流程并支持生产环境部署
- 引入多阶段构建,分离构建与运行时环境 - 使用node:20-alpine作为构建基础镜像,减小体积 - 添加pnpm包管理器并优化依赖安装流程 - 利用缓存机制提升构建效率 - 新增nginx.conf配置文件解决Vue Router历史模式404问题 - 设置静态资源缓存策略提升性能 - 更改默认启动命令为Nginx服务方式运行应用 - 移除开发服务器相关指令,适配生产部署需求
This commit is contained in:
17
nginx.conf
Normal file
17
nginx.conf
Normal file
@@ -0,0 +1,17 @@
|
||||
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";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user