Skip to content

Commit

Permalink
Dockerfile / build
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingFathead committed Oct 13, 2024
1 parent b0ba4ec commit dca6107
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
FROM python:slim-bookworm
FROM python:3.11-slim-bookworm

# Install dependencies & clean up to reduce Docker image size
# Install dependencies & Rust
RUN apt-get update && apt-get install -y \
ffmpeg \
lynx \
gcc \
git \
rustc \
cargo \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*


# Install Rust using rustup
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# Add Rust to PATH
ENV PATH="/root/.cargo/bin:${PATH}"

WORKDIR /app

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

# Remove build dependencies to reduce image size
RUN apt-get update && apt-get remove -y curl gcc git && apt-get autoremove -y && \
rm -rf /root/.cargo /root/.rustup /var/lib/apt/lists/*

# Copy the entire project into the container
COPY . .

Expand Down

0 comments on commit dca6107

Please sign in to comment.