test runner - fix v7
Some checks failed
Build and Deploy Flask App / setup (push) Successful in 2s
Build and Deploy Flask App / test (push) Successful in 35s
Build and Deploy Flask App / build-and-push (push) Failing after 2m1s
Build and Deploy Flask App / deploy (push) Has been skipped

This commit is contained in:
Norvicdev 2026-08-04 22:08:17 +03:00
parent 47cbbc92cf
commit fa10819073
2 changed files with 19 additions and 7 deletions

View file

@ -71,6 +71,15 @@ jobs:
git clone https://vicsergeev.ru/forgejo/Vic/DummyApp.git .
git checkout ${{ github.sha }}
- name: Install Docker CLI
run: |
apt-get update
apt-get install -y ca-certificates curl
curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-26.1.4.tgz -o docker.tgz
tar xzf docker.tgz --strip-components=1 -C /usr/bin docker/docker
rm docker.tgz
docker --version
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

View file

@ -1,20 +1,23 @@
# Многоступенчатая сборка для оптимизации
FROM python:3.14-slim as builder
FROM python:3.12-slim as builder
WORKDIR /app
# Устанавливаем системные зависимости (если нужны для сборки)
RUN apt-get update && apt-get install -y --no-install-recommends gcc && rm -rf /var/lib/apt/lists/*
# Устанавливаем зависимости
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir --user -r requirements.txt
# Финальный образ
FROM python:3.14-slim
FROM python:3.12-slim
WORKDIR /app
# Копируем зависимости из builder
COPY --from=builder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /root/.local /root/.local
ENV PATH=/root/.local/bin:$PATH
# Копируем код приложения
COPY . .
@ -26,9 +29,9 @@ USER appuser
# Экспортируем порт
EXPOSE 5000
# Health check
# Health check (requests должен быть в requirements.txt!)
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:5000/health')" || exit 1
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:5000/health')" || exit 1
# Запускаем через gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "4", "run:app"]