| |
| FROM node:20-slim AS frontend-build |
|
|
| WORKDIR /app/frontend |
| COPY src/frontend/package.json src/frontend/package-lock.json* ./ |
| RUN npm ci 2>/dev/null || npm install |
|
|
| COPY src/frontend/ ./ |
|
|
| |
| ENV NEXT_PUBLIC_WS_URL="" |
| ENV NEXT_PUBLIC_API_URL="" |
| ENV NEXT_TELEMETRY_DISABLED=1 |
|
|
| |
| RUN NODE_OPTIONS=--max-old-space-size=1536 npm run build |
|
|
|
|
| |
| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| nginx \ |
| curl \ |
| && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ |
| && apt-get install -y --no-install-recommends nodejs \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| WORKDIR /app/backend |
| COPY src/backend/requirements.txt ./ |
|
|
| |
| RUN pip install --no-cache-dir \ |
| fastapi==0.115.0 \ |
| "uvicorn[standard]==0.30.6" \ |
| websockets==12.0 \ |
| pydantic-settings==2.5.2 \ |
| python-dotenv==1.0.1 \ |
| openai==1.51.0 \ |
| httpx==0.27.2 \ |
| chromadb==0.5.7 \ |
| sentence-transformers==3.1.1 \ |
| python-multipart==0.0.10 |
|
|
| |
| COPY src/backend/app/ ./app/ |
|
|
| |
| |
| WORKDIR /app/frontend |
| COPY --from=frontend-build /app/frontend/.next/standalone ./ |
| COPY --from=frontend-build /app/frontend/.next/static ./.next/static |
| RUN mkdir -p ./public |
|
|
| |
| COPY space/nginx.conf /etc/nginx/nginx.conf |
|
|
| |
| COPY space/start.sh /app/start.sh |
| RUN chmod +x /app/start.sh |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ |
| CMD curl -f http://localhost:7860/api/health || exit 1 |
|
|
| CMD ["/app/start.sh"] |
|
|