CoolFace
Apppublic

ArxAlfa/AIIASpace

sourceHugging Faceupdated 3y agoView on Hugging Face
1likes
Dockerfile27 linesDownload Raw Back to root
1# Use the official Python 3.9 image2FROM python:3.9-slim3 4# Set the working directory to /code5WORKDIR /code6 7# Copy the current directory contents into the container at /code8COPY ./requirements.txt /code/requirements.txt9 10# Install requirements.txt 11RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt12 13# # Set up a new user named "user" with user ID 100014RUN useradd -m -u 1000 user15# # Switch to the "user" user16USER user17# # Set home to the user's home directory18ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH19 20# # Set the working directory to the user's home directory21WORKDIR $HOME/app22 23# # Copy the current directory contents into the container at $HOME/app setting the owner to the user24COPY --chown=user . $HOME/app25 26# Start the FastAPI app on port 7860, the default port expected by Spaces27CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]