Spaces:
Runtime error
Runtime error
Commit ·
37ecdfa
1
Parent(s): 04d3d7c
Update Dockerfile
Browse files- Dockerfile +15 -8
Dockerfile
CHANGED
|
@@ -1,21 +1,28 @@
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
|
|
|
| 3 |
|
| 4 |
WORKDIR /code
|
| 5 |
|
| 6 |
-
|
| 7 |
-
RUN mkdir -p /.cache/huggingface/hub && chmod -R 777 /.cache
|
| 8 |
|
| 9 |
-
|
| 10 |
-
ENV TRANSFORMERS_CACHE /.cache/huggingface/hub
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
-
RUN pip3 install -r requirements.txt
|
| 18 |
|
| 19 |
|
| 20 |
-
COPY . .
|
| 21 |
CMD ["python","gradio_app.py"]
|
|
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
| 3 |
+
FROM python:3.9
|
| 4 |
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
+
COPY ./requirements.txt /code/requirements.txt
|
|
|
|
| 8 |
|
| 9 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
|
|
| 10 |
|
| 11 |
+
# Set up a new user named "user" with user ID 1000
|
| 12 |
+
RUN useradd -m -u 1000 user
|
| 13 |
+
# Switch to the "user" user
|
| 14 |
+
USER user
|
| 15 |
+
# Set home to the user's home directory
|
| 16 |
+
ENV HOME=/home/user \
|
| 17 |
+
PATH=/home/user/.local/bin:$PATH
|
| 18 |
|
| 19 |
+
# Set the working directory to the user's home directory
|
| 20 |
+
WORKDIR $HOME/app
|
| 21 |
|
| 22 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 23 |
+
COPY --chown=user . $HOME/app
|
| 24 |
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
+
#COPY . .
|
| 28 |
CMD ["python","gradio_app.py"]
|