hoduy99/react-test
0
1# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker2# you will also find guides on how best to write your Dockerfile3 4# Use an official Node runtime as a parent image5FROM node:16 as node-builder6 7# Set the working directory in the container8WORKDIR /app9 10# Copy package.json and package-lock.json11COPY package*.json ./12 13# Install dependencies14RUN npm install15 16# Copy the rest of the application code17COPY . .18 19# Build the React app20RUN npm run build21 22# Use an official Python runtime as a parent image23FROM python:3.924 25# Create a new user26RUN useradd -m -u 1000 user27USER user28ENV PATH="/home/user/.local/bin:$PATH"29 30# Set the working directory in the container31WORKDIR /app32 33# Copy the built React app from the node-builder stage34COPY --from=node-builder /app/build /app/build35 36# Copy requirements.txt and install Python dependencies37COPY --chown=user ./requirements.txt requirements.txt38RUN pip install --no-cache-dir --upgrade -r requirements.txt39 40# Copy the rest of the application code41COPY --chown=user . /app42 43# Expose the port the app runs on44EXPOSE 786045 46# Command to run the application47CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]48 49 50 51 