CoolFace
Apppublic

srinuksv/fastapi-react

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
Dockerfile25 linesDownload Raw Back to root
1# Stage 1: Build the React app2FROM node:18 AS build3 4WORKDIR /app/frontend5COPY frontend/package.json ./6RUN npm install7COPY frontend/src ./src8RUN npm run build9 10# Stage 2: Set up FastAPI11FROM python:3.12-slim12 13WORKDIR /app14 15# Install FastAPI and Uvicorn16COPY app/requirements.txt ./17RUN pip install --no-cache-dir -r requirements.txt18 19# Copy the built React app from the previous stage20COPY --from=build /app/frontend/build ./frontend/build21COPY app/main.py ./app/22 23# Command to run the FastAPI app24CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]25