Skip to content

Commit

Permalink
🧹 Optimize apt installation process in Dockerfile (#6153)
Browse files Browse the repository at this point in the history
Merge multiple apt install commands into a single command to minimize redundant dependency resolution. Also, remove apt cache files after installation to reduce Docker image size.

**How to test**

Follow these steps to verify this PR works as intended:

* Run `docker build` command like: `docker build -t hedy .`.

**Checklist**

- [x] Contains one of the PR categories in the name
- [x] Describes changes in the format above
- [ ] Links to an existing issue or discussion
- [x] Has a "How to test" section
  • Loading branch information
PeterDaveHello authored Feb 4, 2025
1 parent 3f2c029 commit a3683e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ FROM python:3.12-slim
COPY requirements.txt /tmp/requirements.txt

RUN apt update && \
apt install build-essential -y && \
apt install -y curl && \
apt install build-essential curl -y && \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/* && \
pip3 install --no-cache-dir -r /tmp/requirements.txt

WORKDIR /app
Expand Down

0 comments on commit a3683e7

Please sign in to comment.