42 lines
1.5 KiB
Docker
42 lines
1.5 KiB
Docker
|
|
# PPTist 构建 & 部署
|
|||
|
|
FROM docker.1ms.run/node:20 AS builder
|
|||
|
|
ENV http_proxy=http://219.234.197.247:53128
|
|||
|
|
ENV https_proxy=http://219.234.197.247:53128
|
|||
|
|
ENV no_proxy=localhost,127.0.0.1,10.0.0.0/8,192.168.0.0/16,172.17.0.0/16
|
|||
|
|
WORKDIR /app
|
|||
|
|
COPY PPTist/package*.json ./
|
|||
|
|
RUN npm config set registry https://registry.npmmirror.com && npm install
|
|||
|
|
COPY PPTist/ .
|
|||
|
|
|
|||
|
|
# 修改 SERVER_URL: 生产环境使用相对路径 /pptapi,由 nginx 反代到 AI 后端
|
|||
|
|
RUN sed -i "s|'https://server.pptist.cn'|'/pptapi'|g" src/services/index.ts
|
|||
|
|
|
|||
|
|
# 修改模型选项为 deepseek-v3
|
|||
|
|
RUN sed -i "s/glm-4\.7-flash/deepseek-v3/g" src/views/Editor/AIPPTDialog.vue && \
|
|||
|
|
sed -i "s/GLM-4\.7-Flash/DeepSeek-V3/g" src/views/Editor/AIPPTDialog.vue && \
|
|||
|
|
sed -i "s/doubao-seed-1\.6-flash/deepseek-v3/g" src/views/Editor/AIPPTDialog.vue && \
|
|||
|
|
sed -i "s/Doubao-Seed-1\.6-Flash/DeepSeek-V3/g" src/views/Editor/AIPPTDialog.vue && \
|
|||
|
|
sed -i "s/GLM-4\.5-Flash/DeepSeek-V3/g" src/services/index.ts
|
|||
|
|
|
|||
|
|
RUN npm run build
|
|||
|
|
|
|||
|
|
# 生产阶段
|
|||
|
|
FROM docker.1ms.run/nginx:alpine
|
|||
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|||
|
|
RUN echo 'server { \
|
|||
|
|
listen 80; \
|
|||
|
|
root /usr/share/nginx/html; \
|
|||
|
|
index index.html; \
|
|||
|
|
location / { \
|
|||
|
|
try_files $uri $uri/ /index.html; \
|
|||
|
|
} \
|
|||
|
|
location /pptapi/ { \
|
|||
|
|
proxy_pass http://172.17.0.1:18086/; \
|
|||
|
|
proxy_http_version 1.1; \
|
|||
|
|
proxy_set_header Connection ""; \
|
|||
|
|
proxy_buffering off; \
|
|||
|
|
proxy_cache off; \
|
|||
|
|
} \
|
|||
|
|
}' > /etc/nginx/conf.d/default.conf
|
|||
|
|
EXPOSE 80
|