add user in Dockerfile (ref. https://huggingface.co/docs/hub/spaces-sdks-docker#permissions)
Browse files- Dockerfile +10 -2
Dockerfile
CHANGED
@@ -1,9 +1,17 @@
|
|
1 |
FROM python:3.11-slim
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
-
COPY --chown=user:user . .
|
6 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
7 |
EXPOSE 7860
|
8 |
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
9 |
|
|
|
1 |
FROM python:3.11-slim
|
2 |
|
3 |
+
RUN useradd -m -u 1000 user
|
4 |
+
USER user
|
5 |
+
|
6 |
+
ENV HOME=/home/user \
|
7 |
+
PATH=/home/user/.local/bin:$PATH
|
8 |
+
|
9 |
+
WORKDIR $HOME/app
|
10 |
|
|
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
+
|
13 |
+
COPY --chown=user . $HOME/app
|
14 |
+
|
15 |
EXPOSE 7860
|
16 |
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
17 |
|