Fix Docker configuration for deployment

- Update backend Dockerfile to use Rust 1.85 (edition 2024 support)
- Add Aliyun mirrors for Alpine packages
- Add rsproxy.cn mirror for cargo crates
- Enable static OpenSSL linking
- Fix frontend Dockerfile to use NEXT_PUBLIC_API_BASE
- Add mkdir -p public to ensure public dir exists
- Update docker-compose files to use correct env var names
- Add docker-compose.deploy.yml for production deployment

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Michael Dong
2026-02-05 18:35:45 +08:00
parent 86d3a8c419
commit faf9f3abcf
4 changed files with 58 additions and 7 deletions

View File

@@ -4,8 +4,8 @@ FROM node:20-alpine AS builder
WORKDIR /app
# 构建参数NEXT_PUBLIC_* 变量需要在构建时注入)
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
ARG NEXT_PUBLIC_API_BASE
ENV NEXT_PUBLIC_API_BASE=${NEXT_PUBLIC_API_BASE}
# Copy package files
COPY package*.json ./
@@ -16,6 +16,9 @@ RUN npm ci
# Copy source code
COPY . .
# Ensure public directory exists
RUN mkdir -p public
# Build Next.js app
RUN npm run build