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

@@ -44,14 +44,14 @@ services:
dockerfile: Dockerfile
args:
# 构建时注入 API URL用于 Next.js 静态优化)
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-}
NEXT_PUBLIC_API_BASE: ${NEXT_PUBLIC_API_BASE:-}
container_name: notify-frontend
restart: unless-stopped
depends_on:
- backend
environment:
# 运行时 API URL用于 SSR
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-}
NEXT_PUBLIC_API_BASE: ${NEXT_PUBLIC_API_BASE:-}
ports:
- "127.0.0.1:3000:3000"