From 9273fd7e9a20353f38e20909174c21cc81351035 Mon Sep 17 00:00:00 2001 From: Alex55 Date: Sun, 5 Apr 2026 11:05:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 70 ++++++++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index ebb159c..01aac14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,41 +1,29 @@ -FROM python:3.12-bookworm - -# ✅ Устанавливаем все зависимости включая openresolv -RUN apt-get update && apt-get install -y --no-install-recommends \ - apt-transport-https \ - gnupg \ - lsb-release \ - curl \ - ca-certificates \ - wireguard \ - nano \ - iptables \ - iproute2 \ - openresolv \ - && rm -rf /var/lib/apt/lists/* - -# Устанавливаем UV -ADD https://astral.sh/uv/install.sh /uv-installer.sh -RUN sh /uv-installer.sh && rm /uv-installer.sh -ENV PATH="/root/.local/bin/:$PATH" - -# Рабочая директория -WORKDIR /app - -# Копируем проект -COPY . /app - -# Копируем start.sh -COPY start.sh /app/start.sh - -# ✅ Исправляем права на конфиг WireGuard (должно быть 600) -RUN chmod 600 /app/wireguard/wg_confs/wg0.conf - -# Устанавливаем зависимости Python -RUN uv sync --frozen - -# Порт Flask -EXPOSE 5205 - -# Запуск -CMD ["/app/start.sh"] +FROM python:3.12-slim-bookworm + +# The installer requires curl (and certificates) to download the release archive +RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates nano + +# Download the latest installer +ADD https://astral.sh/uv/install.sh /uv-installer.sh + +# Run the installer then remove it +RUN sh /uv-installer.sh && rm /uv-installer.sh + +# Ensure the installed binary is on the `PATH` +ENV PATH="/root/.local/bin/:$PATH" + + +# Copy the project into the image +ADD . /app + +# Sync the project into a new environment, using the frozen lockfile +WORKDIR /app + +RUN uv sync --frozen + +# Expose port 8000 +EXPOSE 5205 + + +# Presuming there is a `my_app` command provided by the project uvicorn main:app --reload +CMD ["uv", "run", "main.py"] \ No newline at end of file