Spaces:
Build error
Build error
dock
Browse files- Dockerfile +11 -4
Dockerfile
CHANGED
|
@@ -1,13 +1,20 @@
|
|
| 1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
-
FROM python:3.
|
| 5 |
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
COPY . .
|
| 13 |
|
|
|
|
| 1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
+
FROM python:3.10-slim
|
| 5 |
|
| 6 |
+
# Set the working directory to the user's home directory
|
| 7 |
+
WORKDIR $HOME/app
|
| 8 |
|
| 9 |
+
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
| 10 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 11 |
|
| 12 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 13 |
+
COPY --chown=user . $HOME/app
|
| 14 |
+
|
| 15 |
+
COPY ./requirements.txt $HOME/app/requirements.txt
|
| 16 |
+
|
| 17 |
+
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
|
| 18 |
|
| 19 |
COPY . .
|
| 20 |
|