diff --git a/.gitignore b/.gitignore index 45a4f64..e9abf5b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ ENV/ *.jar # tmp -tmp/ \ No newline at end of file +tmp/ +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e1d9a5b..09d1edf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9 +FROM python:3.9-slim-bullseye WORKDIR /ai @@ -6,8 +6,12 @@ WORKDIR /ai 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/ .