Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -9
Dockerfile
CHANGED
|
@@ -1,5 +1,15 @@
|
|
| 1 |
# Use Python 3.10 as base image
|
| 2 |
FROM python:3.10-slim
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
# Set up a new user named "user" with user ID 1000
|
| 4 |
RUN useradd -m -u 1000 user
|
| 5 |
|
|
@@ -13,17 +23,10 @@ ENV HOME=/home/user \
|
|
| 13 |
# Set the working directory to the user's home directory
|
| 14 |
WORKDIR $HOME/app
|
| 15 |
|
| 16 |
-
|
| 17 |
-
RUN apt-get update && apt-get install -y \
|
| 18 |
-
poppler-utils \
|
| 19 |
-
curl \
|
| 20 |
-
&& rm -rf /var/lib/apt/lists/* \
|
| 21 |
-
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
|
| 22 |
-
&& echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc \
|
| 23 |
-
&& . ~/.bashrc
|
| 24 |
|
| 25 |
# Copy requirements first to leverage Docker cache
|
| 26 |
-
COPY pyproject.toml .
|
| 27 |
|
| 28 |
# Install Python dependencies using uv
|
| 29 |
RUN . ~/.bashrc && uv pip install -r pyproject.toml --system
|
|
|
|
| 1 |
# Use Python 3.10 as base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Install system dependencies and uv
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
poppler-utils \
|
| 7 |
+
curl \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 9 |
+
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
|
| 10 |
+
&& echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc \
|
| 11 |
+
&& . ~/.bashrc
|
| 12 |
+
|
| 13 |
# Set up a new user named "user" with user ID 1000
|
| 14 |
RUN useradd -m -u 1000 user
|
| 15 |
|
|
|
|
| 23 |
# Set the working directory to the user's home directory
|
| 24 |
WORKDIR $HOME/app
|
| 25 |
|
| 26 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
# Copy requirements first to leverage Docker cache
|
| 29 |
+
COPY --chown=user pyproject.toml .
|
| 30 |
|
| 31 |
# Install Python dependencies using uv
|
| 32 |
RUN . ~/.bashrc && uv pip install -r pyproject.toml --system
|