Spaces:
Runtime error
Runtime error
Dmitry Beresnev
commited on
Commit
·
fd7be58
1
Parent(s):
16801eb
fix dockerfile
Browse files- Dockerfile +4 -1
Dockerfile
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
FROM python:3.12-slim
|
| 2 |
|
|
|
|
| 3 |
|
| 4 |
# Set up a new user named "user" with user ID 1000
|
| 5 |
RUN useradd -m -u 1000 user
|
|
@@ -14,6 +15,8 @@ ENV HOME=/home/user \
|
|
| 14 |
PYTHONUNBUFFERED=1 \
|
| 15 |
PYTHONDONTWRITEBYTECODE=1
|
| 16 |
|
|
|
|
|
|
|
| 17 |
# Set the working directory to the user's home directory
|
| 18 |
WORKDIR $HOME/app
|
| 19 |
|
|
@@ -24,7 +27,7 @@ RUN pip install --no-cache-dir --upgrade pip
|
|
| 24 |
COPY --chown=user requirements.txt $HOME/app/
|
| 25 |
|
| 26 |
# Install Python dependencies in user space
|
| 27 |
-
RUN pip install --no-cache-dir
|
| 28 |
|
| 29 |
# Copy source code with proper ownership
|
| 30 |
COPY --chown=user src/ $HOME/app/src/
|
|
|
|
| 1 |
FROM python:3.12-slim
|
| 2 |
|
| 3 |
+
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 4 |
|
| 5 |
# Set up a new user named "user" with user ID 1000
|
| 6 |
RUN useradd -m -u 1000 user
|
|
|
|
| 15 |
PYTHONUNBUFFERED=1 \
|
| 16 |
PYTHONDONTWRITEBYTECODE=1
|
| 17 |
|
| 18 |
+
ENV PYTHONPATH="$HOME/.local/lib/python3.12/site-packages:$PYTHONPATH"
|
| 19 |
+
|
| 20 |
# Set the working directory to the user's home directory
|
| 21 |
WORKDIR $HOME/app
|
| 22 |
|
|
|
|
| 27 |
COPY --chown=user requirements.txt $HOME/app/
|
| 28 |
|
| 29 |
# Install Python dependencies in user space
|
| 30 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 31 |
|
| 32 |
# Copy source code with proper ownership
|
| 33 |
COPY --chown=user src/ $HOME/app/src/
|