From e23a015cdf9cb50adbeb919199bb587fb45e2afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Mon, 22 Sep 2025 08:27:41 +0200 Subject: [PATCH] docker --- Dockerfile | 6 +----- docker-compose.yml | 28 ++++++++++++++++++---------- requirements.txt | 2 -- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6ba83f3..f21839c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,7 @@ FROM python:3.13-slim - WORKDIR /app - COPY requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt - COPY . . - -CMD ["python", "run_waitress.py"] +CMD ["python3", "run_waitress.py"] diff --git a/docker-compose.yml b/docker-compose.yml index 6191144..bceb0e7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,23 @@ -version: '3.8' - services: - app: - build: - context: . - dockerfile: Dockerfile + routeros_backup: + build: . container_name: routeros_backup ports: - "5581:5581" - environment: - - FLASK_ENV=production - restart: unless-stopped + healthcheck: + test: + [ + "CMD", + "python", + "-c", + "import urllib.request; import sys; sys.exit(0) if urllib.request.urlopen('http://localhost:5581/login').getcode() == 200 else sys.exit(1)" + ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s volumes: - - ./data:/data + - .:/app + - ./instance:/app/instance + - ./data:/app/data + restart: unless-stopped \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3bbd513..58144b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,8 +4,6 @@ passlib paramiko APScheduler requests -#gunicorn flask_wtf gevent -#croniter waitress \ No newline at end of file