Skip to content

minimize the docker file size using torch CPU version #1246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ RUN apt-get update && \
# Set LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
# Copy requirements file and install Python dependencies
COPY requirements.txt /code/
COPY requirements.txt constraints.txt /code/
# --no-cache-dir --upgrade
RUN pip install -r requirements.txt
RUN pip install --upgrade pip
RUN pip install -r requirements.txt -c constraints.txt
# Copy application code
COPY . /code
# Set command
Expand Down
4 changes: 4 additions & 0 deletions backend/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-f https://download.pytorch.org/whl/torch_stable.html
torch==2.3.1+cpu
torchvision==0.18.1+cpu
torchaudio==2.3.1+cpu