Commit
·
689e893
1
Parent(s):
add2842
fixing user
Browse files- .dockerignore +0 -0
- Dockerfile +15 -4
.dockerignore
ADDED
|
File without changes
|
Dockerfile
CHANGED
|
@@ -1,18 +1,29 @@
|
|
| 1 |
FROM python:3.13.5-slim
|
| 2 |
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
curl \
|
| 8 |
git \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
-
COPY requirements.txt ./
|
| 12 |
-
COPY . .
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
RUN pip3 install -r requirements.txt
|
| 15 |
|
|
|
|
|
|
|
| 16 |
EXPOSE 8501
|
| 17 |
|
| 18 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
|
|
|
| 1 |
FROM python:3.13.5-slim
|
| 2 |
|
|
|
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
build-essential \
|
| 5 |
curl \
|
| 6 |
git \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
RUN useradd -m -u 1000 user
|
| 11 |
+
|
| 12 |
+
# Switch to the "user" user
|
| 13 |
+
USER user
|
| 14 |
+
|
| 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 requirements.txt ./
|
| 23 |
RUN pip3 install -r requirements.txt
|
| 24 |
|
| 25 |
+
COPY . .
|
| 26 |
+
|
| 27 |
EXPOSE 8501
|
| 28 |
|
| 29 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|