Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +11 -1
Dockerfile
CHANGED
|
@@ -13,8 +13,18 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
| 13 |
# Set the working directory to the user's home directory
|
| 14 |
WORKDIR $HOME/app
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 17 |
-
COPY --chown=
|
| 18 |
|
| 19 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
| 20 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 13 |
# Set the working directory to the user's home directory
|
| 14 |
WORKDIR $HOME/app
|
| 15 |
|
| 16 |
+
# Set up a new user named "user" with user ID 1000
|
| 17 |
+
RUN useradd -m -u 1000 user
|
| 18 |
+
# Switch to the "user" user
|
| 19 |
+
USER user
|
| 20 |
+
# Set home to the user's home directory
|
| 21 |
+
ENV HOME=/home/user \\ PATH=/home/user/.local/bin:$PATH
|
| 22 |
+
|
| 23 |
+
# Set the working directory to the user's home directory
|
| 24 |
+
WORKDIR $HOME/app
|
| 25 |
+
|
| 26 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 27 |
+
COPY --chown=user . $HOME/app
|
| 28 |
|
| 29 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
| 30 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|