Added docker support

This commit is contained in:
2026-09-23 03:26:09 +03:00
parent 22cc5d0034
commit 4b0a19713a
13 changed files with 186 additions and 95 deletions

36
Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
# syntax=docker/dockerfile:1
ARG GPU=nvidia
FROM nvidia/cuda:13.0.2-cudnn-runtime-ubuntu24.04 AS base-nvidia
FROM rocm/dev-ubuntu-24.04:7.2.1-complete AS base-amd
FROM base-${GPU} AS app
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
XDG_CACHE_HOME=/tmp/sumka-cache
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl ffmpeg fonts-dejavu-core \
python3 python3-pip python3-venv \
&& curl -fsSL -o /tmp/chrome.deb \
https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt-get install -y /tmp/chrome.deb \
&& rm -rf /var/lib/apt/lists/* /tmp/chrome.deb
WORKDIR /app
COPY requirements.txt requirements-nvidia.txt requirements-amd.txt ./
ARG GPU
RUN python3 -m venv /opt/venv \
&& /opt/venv/bin/pip install --no-cache-dir --upgrade pip \
&& /opt/venv/bin/pip install --no-cache-dir -r requirements-${GPU}.txt
ENV PATH=/opt/venv/bin:$PATH
COPY . ./
WORKDIR /work
ENTRYPOINT ["python3", "/app/main.py"]