Spaces:
Runtime error
Runtime error
Commit
·
27b79c7
1
Parent(s):
896e60d
update Dockerfile to limit user access
Browse files- Dockerfile +16 -11
Dockerfile
CHANGED
|
@@ -1,22 +1,27 @@
|
|
| 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 ubuntu:22.04
|
| 5 |
-
|
| 6 |
-
|
|
|
|
| 7 |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
|
| 8 |
apt-get install -y git-lfs
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
RUN git lfs clone https://huggingface.co/AskUI/pta-text-0.1 /code/model/
|
| 13 |
-
|
| 14 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
|
|
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
CMD ["python3", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
+
|
| 3 |
+
# Install system dependencies
|
| 4 |
+
RUN apt-get update && apt-get install -y curl git python3 python3-pip && \
|
| 5 |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
|
| 6 |
apt-get install -y git-lfs
|
| 7 |
|
| 8 |
+
# Install Python dependencies
|
|
|
|
|
|
|
|
|
|
| 9 |
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 11 |
|
| 12 |
+
# Create a user, set environment variables, and define work directory
|
| 13 |
+
RUN useradd -m -u 1000 user
|
| 14 |
+
USER user
|
| 15 |
+
ENV HOME=/home/user \
|
| 16 |
+
PATH=/home/user/.local/bin:$PATH
|
| 17 |
|
| 18 |
+
WORKDIR $HOME/app
|
| 19 |
+
COPY --chown=user . $HOME/app
|
| 20 |
|
| 21 |
+
# Continue with the rest of the setup
|
| 22 |
+
WORKDIR /code
|
| 23 |
+
|
| 24 |
+
RUN git lfs clone https://huggingface.co/AskUI/pta-text-0.1 /code/model/
|
| 25 |
COPY . .
|
| 26 |
|
| 27 |
CMD ["python3", "app.py"]
|