Files
rkllm-gradio-server/Dockerfile
drholy 35d0a9db6d
All checks were successful
Build, Push and Redeploy Docker Image / build-and-push (push) Successful in 7m16s
fix 3
2026-02-03 21:06:11 +07:00

54 lines
1.9 KiB
Docker
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Базовый образ с Python 3.11.11
FROM python:3.11.11
# Установка метаданных
LABEL description="Docker image with Python 3.11.11 and required packages"
# Обновление системы и установка базовых зависимостей
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
curl \
wget \
nano \
sudo \
apt-utils \
cmake \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Кэшируем установку зависимостей Python
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install setuptools wheel && \
pip install --no-cache-dir -r requirements.txt
# Сборка RKLLM runtime
RUN git clone --depth 1 https://git.byte-mate.ru/drholy/ezrknn-llm /tmp/rkllm-build && \
cp -r /tmp/rkllm-build/rkllm-runtime/runtime/Linux/librkllm_api/aarch64/* /usr/lib && \
cp -r /tmp/rkllm-build/rkllm-runtime/runtime/Linux/librkllm_api/include/* /usr/local/include && \
cd /tmp/rkllm-build/rkllm-runtime/examples/rkllm_api_demo && \
bash build-linux.sh && \
cp ./build/build_linux_aarch64_Release/llm_demo /usr/bin/rkllm && \
# Очистка временных файлов сборки
ldconfig && \
rm -rf /tmp/rkllm-build && \
apt-get purge -y git cmake build-essential libssl-dev && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Копируем приложение (исключая кэш и модели)
COPY app/ .
# Исключаем модели из образа — монтируем как volume при запуске
RUN rm -rf /app/models/* 2>/dev/null || true && \
find /app -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \
chmod +x /app/entrypoint.sh
# Порт Gradio по умолчанию
EXPOSE 8080
WORKDIR /app
ENTRYPOINT ["/app/entrypoint.sh"]