Commit cb1e64c9 by zhangxingmin

push

parent d8291e32
...@@ -20,17 +20,18 @@ COPY . . ...@@ -20,17 +20,18 @@ COPY . .
# 构建生产产物 # 构建生产产物
RUN npm run build RUN npm run build
# 第二阶段:部署到 Nginx # 生产阶段
FROM registry.cn-hangzhou.aliyuncs.com/library/nginx:1.21-alpine FROM docker.m.daocloud.io/library/nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
# 复制构建产物到 Nginx 静态目录
COPY --from=builder /app/dist /usr/share/nginx/html
# 复制自定义 Nginx 配置(解决单页应用路由问题)
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
# 暴露端口 # 设置时区
EXPOSE 8333 RUN echo "https://mirrors.aliyun.com/alpine/v3.22/main/" > /etc/apk/repositories && \
echo "https://mirrors.aliyun.com/alpine/v3.22/community/" >> /etc/apk/repositories && \
apk update && \
apk add --no-cache tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone
# 启动 Nginx EXPOSE 8333
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment