From d1023547504adec9574b1821b0efc134b1d8323e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Mon, 22 Sep 2025 08:43:53 +0200 Subject: [PATCH] docker --- Dockerfile | 6 +----- docker-compose.yml | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index ab40dd8..dc4d2b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,9 @@ FROM python:3.13-slim WORKDIR /app - COPY requirements.txt requirements.txt RUN apt-get update && apt-get install -y build-essential && \ pip install --upgrade pip && pip install -r requirements.txt COPY . . RUN mkdir -p /app/instance - -EXPOSE 5583 - -CMD ["python", "run_waitress.py"] \ No newline at end of file +CMD ["python3", "run_waitress.py"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index bddb626..2a07713 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,21 @@ -version: '3.8' - services: - app: - build: - context: . - dockerfile: Dockerfile + routeros_backup: + build: . + container_name: routeros_backup ports: - "5583:5583" + healthcheck: + test: + [ + "CMD", + "python", + "-c", + "import urllib.request; import sys; sys.exit(0) if urllib.request.urlopen('http://localhost:5583/login').getcode() == 200 else sys.exit(1)" + ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s volumes: - - ./instance:/app/instance + - .:/app restart: unless-stopped \ No newline at end of file