Team Ai
Apppublic

Jashan02/Machine_learning

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes
Dockerfile44 linesDownload Raw Back to root
1FROM python:3.92	3WORKDIR /code4COPY ./requirements.txt /code/requirements.txt5	6RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt7RUN useradd -m -u 1000 user8USER user9ENV HOME=/home/user \10    PATH=/home/user/.local/bin:$PATH11 12	13WORKDIR $HOME/app14COPY --chown=user . $HOME/app15CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]16 17# Use the official Python 3.9 image18FROM python:3.919 20# Set the working directory to /code21WORKDIR /code22 23# Copy the current directory contents into the container at /code24COPY ./requirements.txt /code/requirements.txt25 26# Install requirements.txt 27RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt28 29# Set up a new user named "user" with user ID 100030RUN useradd -m -u 1000 user31# Switch to the "user" user32USER user33# Set home to the user's home directory34ENV HOME=/home/user \35    PATH=/home/user/.local/bin:$PATH36 37# Set the working directory to the user's home directory38WORKDIR $HOME/app39 40# Copy the current directory contents into the container at $HOME/app setting the owner to the user41COPY --chown=user . $HOME/app42 43# Start the FastAPI app on port 7860, the default port expected by Spaces44CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]