feat: remove GPU support and simplify to CPU-only architecture
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m35s
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m35s
This commit is contained in:
38
Dockerfile
38
Dockerfile
@@ -1,42 +1,18 @@
|
||||
ARG VARIANT=cpu
|
||||
|
||||
# ---- CPU base ----
|
||||
FROM python:3.11-slim AS base-cpu
|
||||
# ---- Base Stage ----
|
||||
FROM python:3.11-slim AS base
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl libgl1 libglib2.0-0 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python dependencies
|
||||
COPY requirements.txt /tmp/requirements.txt
|
||||
COPY requirements-cpu.txt /tmp/requirements-cpu.txt
|
||||
RUN pip install --no-cache-dir -r /tmp/requirements.txt -r /tmp/requirements-cpu.txt \
|
||||
RUN pip install --no-cache-dir -r /tmp/requirements.txt \
|
||||
&& rm /tmp/requirements*.txt
|
||||
|
||||
# ---- GPU base (CUDA 12.4) ----
|
||||
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 AS base-gpu
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
software-properties-common \
|
||||
&& add-apt-repository ppa:deadsnakes/ppa \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
python3.11 python3.11-venv python3.11-dev \
|
||||
curl libgl1 libglib2.0-0 \
|
||||
&& ln -sf /usr/bin/python3.11 /usr/bin/python3 \
|
||||
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
||||
&& python3 -m ensurepip --upgrade \
|
||||
&& python3 -m pip install --no-cache-dir --upgrade pip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt /tmp/requirements.txt
|
||||
COPY requirements-gpu.txt /tmp/requirements-gpu.txt
|
||||
RUN pip install --no-cache-dir -r /tmp/requirements.txt -r /tmp/requirements-gpu.txt \
|
||||
&& rm /tmp/requirements*.txt
|
||||
|
||||
# ---- Final stage ----
|
||||
FROM base-${VARIANT} AS final
|
||||
# ---- Final Stage ----
|
||||
FROM base AS final
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user