Skip to content

Commit dca6107

Browse files
committed
Dockerfile / build
1 parent b0ba4ec commit dca6107

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Dockerfile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
FROM python:slim-bookworm
1+
FROM python:3.11-slim-bookworm
22

3-
# Install dependencies & clean up to reduce Docker image size
3+
# Install dependencies & Rust
44
RUN apt-get update && apt-get install -y \
55
ffmpeg \
66
lynx \
77
gcc \
88
git \
9-
rustc \
10-
cargo \
9+
curl \
1110
&& apt-get clean \
1211
&& rm -rf /var/lib/apt/lists/*
13-
12+
13+
# Install Rust using rustup
14+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
15+
16+
# Add Rust to PATH
17+
ENV PATH="/root/.cargo/bin:${PATH}"
18+
1419
WORKDIR /app
1520

1621
# Copy the requirements file first to leverage Docker cache
@@ -19,6 +24,10 @@ COPY requirements.txt .
1924
# Install Python dependencies
2025
RUN pip3 install --no-cache-dir -r requirements.txt
2126

27+
# Remove build dependencies to reduce image size
28+
RUN apt-get update && apt-get remove -y curl gcc git && apt-get autoremove -y && \
29+
rm -rf /root/.cargo /root/.rustup /var/lib/apt/lists/*
30+
2231
# Copy the entire project into the container
2332
COPY . .
2433

0 commit comments

Comments
 (0)