| FROM python:3.10-slim-buster |
|
|
| WORKDIR /app |
|
|
| ENV TORCH_HOME=/app/cache/torch |
| ENV MPLCONFIGDIR=/app/cache/matplotlib |
|
|
| RUN mkdir -p /app/cache/torch /app/cache/matplotlib \ |
| && chmod -R 777 /app/cache \ |
| && echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list \ |
| && echo "deb http://archive.debian.org/debian-security buster/updates main" >> /etc/apt/sources.list \ |
| && apt-get update -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false && apt-get install -y \ |
| git \ |
| git-lfs \ |
| ffmpeg \ |
| libsm6 \ |
| libxext6 \ |
| cmake \ |
| rsync \ |
| && rm -rf /var/lib/apt/lists/* \ |
| && git lfs install \ |
| && pip install --upgrade pip |
|
|
| COPY requirements.txt . |
|
|
| RUN pip install --no-cache-dir -r requirements.txt \ |
| && pip install --no-cache-dir git+https://github.com/jacobgil/pytorch-grad-cam.git@master |
|
|
| COPY . . |
|
|
| CMD ["python", "app.py"] |