Обновить Dockerfile

This commit is contained in:
Alex55 2026-04-05 11:05:48 +03:00
parent 990d6e9a38
commit 9273fd7e9a
1 changed files with 29 additions and 41 deletions

View File

@ -1,41 +1,29 @@
FROM python:3.12-bookworm FROM python:3.12-slim-bookworm
# ✅ Устанавливаем все зависимости включая openresolv # The installer requires curl (and certificates) to download the release archive
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates nano
apt-transport-https \
gnupg \ # Download the latest installer
lsb-release \ ADD https://astral.sh/uv/install.sh /uv-installer.sh
curl \
ca-certificates \ # Run the installer then remove it
wireguard \ RUN sh /uv-installer.sh && rm /uv-installer.sh
nano \
iptables \ # Ensure the installed binary is on the `PATH`
iproute2 \ ENV PATH="/root/.local/bin/:$PATH"
openresolv \
&& rm -rf /var/lib/apt/lists/*
# Copy the project into the image
# Устанавливаем UV ADD . /app
ADD https://astral.sh/uv/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh # Sync the project into a new environment, using the frozen lockfile
ENV PATH="/root/.local/bin/:$PATH" WORKDIR /app
# Рабочая директория RUN uv sync --frozen
WORKDIR /app
# Expose port 8000
# Копируем проект EXPOSE 5205
COPY . /app
# Копируем start.sh # Presuming there is a `my_app` command provided by the project uvicorn main:app --reload
COPY start.sh /app/start.sh CMD ["uv", "run", "main.py"]
# ✅ Исправляем права на конфиг WireGuard (должно быть 600)
RUN chmod 600 /app/wireguard/wg_confs/wg0.conf
# Устанавливаем зависимости Python
RUN uv sync --frozen
# Порт Flask
EXPOSE 5205
# Запуск
CMD ["/app/start.sh"]