85547d7043
Deploy / deploy (push) Failing after 1m36s
## 修改内容 1. 所有 Dockerfile 中指定 pnpm@8(兼容 lockfileVersion 6.0) 2. 工作流使用 docker compose(V2)而不是 docker-compose ## 修复的问题 - pnpm-lock.yaml 版本不兼容 - 容器中缺少 docker-compose 命令 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
30 lines
1.0 KiB
Docker
30 lines
1.0 KiB
Docker
# 官网 - Next.js 静态导出
|
|
FROM node:18-alpine AS website-builder
|
|
WORKDIR /app
|
|
COPY pnpm-workspace.yaml pnpm-lock.yaml package.json ./
|
|
COPY packages/ ./packages/
|
|
COPY apps/official-website/ ./apps/official-website/
|
|
RUN npm install -g pnpm@8 && pnpm install --frozen-lockfile
|
|
RUN cd apps/official-website && pnpm run build
|
|
|
|
FROM nginx:alpine AS website
|
|
COPY --from=website-builder /app/apps/official-website/out /usr/share/nginx/html
|
|
RUN echo 'server { \
|
|
listen 80; \
|
|
server_name _; \
|
|
root /usr/share/nginx/html; \
|
|
index index.html; \
|
|
location / { \
|
|
try_files $uri $uri.html $uri/ =404; \
|
|
} \
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { \
|
|
expires 30d; \
|
|
add_header Cache-Control "public, immutable"; \
|
|
} \
|
|
gzip on; \
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript; \
|
|
gzip_min_length 1024; \
|
|
}' > /etc/nginx/conf.d/default.conf
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|