Spaces:
Runtime error
Runtime error
File size: 720 Bytes
5bb150a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
FROM node:16-alpine as build-frontend
# Set the working directory
WORKDIR /app
# Copy package files and install dependencies
COPY frontend/package*.json /app/frontend/
RUN npm install --prefix frontend/
RUN npm ci --prefix frontend/
# Copy the rest of the application files
COPY frontend/ /app/frontend/
RUN npm run build --prefix frontend/
# Start a new stage using python:3.9-alpine
FROM python:3.9-alpine
# Copy the built front-end files
COPY --from=build-frontend /app/frontend/build /app/build
COPY /backend /app
# Install uvicorn
RUN pip install uvicorn fastapi
# Set the working directory
WORKDIR /app
# Run the uvicorn server
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
EXPOSE 8000 |