Skip to content

Commit

Permalink
trying to trim down the huge image size due to CUDA
Browse files Browse the repository at this point in the history
  • Loading branch information
Formartha committed Mar 5, 2024
1 parent 6a3827e commit 0de25a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ ENV/
*.jar

# tmp
tmp/
tmp/
.env
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FROM python:3.9
FROM python:3.9-slim-bullseye

WORKDIR /ai

# Copy just the requirements.txt file and install dependencies
COPY ai1899/requirements.txt requirements.txt

RUN apt-get update && \
apt-get install -y git curl && \
pip install --no-cache-dir -r requirements.txt
apt-get install -y git curl

# As the processing power of NVIDIA CUDA isn't always available, the incentive is to trim down the image size.
# By installing the cpu torch first, it will avoid installing the GPU related to NVIDIA CUDA.
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the project directory into the container
COPY ai1899/ .
Expand Down

0 comments on commit 0de25a1

Please sign in to comment.