Team Ai
Apppublic

Decoder2704/python-chatbot-jay

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
Dockerfile36 linesDownload Raw Back to root
1# Hugging Face Space (sdk: docker) — single container: FastAPI + Vite-built React SPA.2# Runtime listens on 0.0.0.0; default PORT=7860 (HF may set PORT).3 4# ---- Stage 1: build React (npm) ----5FROM node:20-bookworm-slim AS web-build6WORKDIR /frontend7 8COPY frontend/package.json frontend/package-lock.json ./9RUN npm ci10 11COPY frontend/ ./12RUN npm run build13 14# ---- Stage 2: FastAPI + static files ----15FROM python:3.12-slim-bookworm AS runtime16WORKDIR /app/backend17 18ENV PYTHONDONTWRITEBYTECODE=119ENV PYTHONUNBUFFERED=120ENV PORT=786021 22COPY backend/requirements.txt ./23RUN pip install --no-cache-dir -r requirements.txt24 25# Full backend tree — include backend/artifacts/*.pkl (must be committed to git for HF).26COPY backend/ ./27# Matches backend/static/dist resolution in app.paths.resolve_frontend_dist_dir()28COPY --from=web-build /frontend/dist ./static/dist29 30COPY docker/entrypoint.sh /entrypoint.sh31RUN chmod +x /entrypoint.sh32 33EXPOSE 786034 35ENTRYPOINT ["/entrypoint.sh"]36