Spaces:
Sleeping
Sleeping
Commit
·
3f4a2df
1
Parent(s):
60ce450
Add folder user
Browse files- Dockerfile +9 -2
Dockerfile
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
FROM python:3.13.5-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
RUN apt-get update && apt-get install -y \
|
|
@@ -8,12 +9,18 @@ RUN apt-get update && apt-get install -y \
|
|
| 8 |
git \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
-
COPY requirements.txt ./
|
| 12 |
-
COPY src/ .env* ./src/
|
| 13 |
|
| 14 |
RUN pip3 install -r requirements.txt
|
| 15 |
|
| 16 |
EXPOSE 8501
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 19 |
|
|
|
|
| 1 |
FROM python:3.13.5-slim
|
| 2 |
|
| 3 |
+
RUN useradd -m -u 1000 user
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 9 |
git \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
COPY --chown=user requirements.txt ./
|
| 13 |
+
COPY --chown=user src/ .env* ./src/
|
| 14 |
|
| 15 |
RUN pip3 install -r requirements.txt
|
| 16 |
|
| 17 |
EXPOSE 8501
|
| 18 |
+
COPY --chown=user . /app
|
| 19 |
+
|
| 20 |
+
USER user
|
| 21 |
+
|
| 22 |
+
ENV HOME=/home/user \
|
| 23 |
+
PATH=/home/user/.local/bin:$PATH
|
| 24 |
|
| 25 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 26 |
|