87d6dcc293
- Remove coze-web service from docker-compose.yml
- Replace nginx second stage in frontend/Dockerfile with alpine dist-only stage
- Add nginx-gateway/ with standalone nginx container deployment
- docker-compose.yml joining both coze-network and kong-net
- Split nginx configs into 6 per-domain files:
- 00-upstreams.conf (shared upstreams)
- 10-default-server.conf (catch-all 444)
- 20-coze.conf (coze studio)
- 30-kong-api.conf (kong ai gateway)
- 40-admin-portal.conf (admin portal)
- 50-grafana.conf (grafana dashboard)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
43 lines
1.3 KiB
Docker
43 lines
1.3 KiB
Docker
# Build stage
|
|
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# if you located in China, you can use aliyun mirror to speed up
|
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
|
|
|
# Install bash git dos2unix for TypeScript compiler
|
|
RUN apk add --no-cache bash git dos2unix
|
|
|
|
# if you located in China, you can use aliyun mirror to speed up
|
|
RUN npm config set registry https://registry.npmmirror.com
|
|
|
|
# Copy rush.json from root directory first
|
|
COPY rush.json ./
|
|
|
|
# Install rush with retry logic
|
|
RUN npm install -g @microsoft/rush --registry=https://registry.npmjs.org
|
|
|
|
# Copy the frontend source code (excluding node_modules and build artifacts)
|
|
COPY frontend/ ./frontend/
|
|
|
|
# Copy common directory for Rush
|
|
COPY common/ ./common/
|
|
|
|
# Copy scripts directory for Rush hooks
|
|
COPY scripts/ ./scripts/
|
|
|
|
# Convert line endings for shell scripts in scripts directory to Unix format
|
|
RUN find . -name "*.sh" -type f -exec dos2unix {} \;
|
|
|
|
# Install all dependencies
|
|
RUN chmod +x scripts/hooks/post-rush-install.sh && rm -rf /app/common/temp && rush install
|
|
|
|
# Use rush build to build the specific project
|
|
RUN rush build --to @coze-studio/app
|
|
|
|
# Dist-only stage: 镜像仅用于提取构建产物,不运行任何服务
|
|
FROM alpine:latest
|
|
WORKDIR /app
|
|
COPY --from=builder /app/frontend/apps/coze-studio/dist /app/dist
|