From 49d7f8a5002538d1c2dcbfea088aae686965bd23 Mon Sep 17 00:00:00 2001 From: Marcin-Ramotowski Date: Sat, 2 Aug 2025 16:16:05 +0200 Subject: [PATCH] Added missing dev functionalities for Docker files from dev branch --- Dockerfile | 17 +++++++++++++++-- docker-compose.yml | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index aafa859..460ab8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,18 @@ -FROM python:3.11.7-slim-bookworm +FROM python:3.11.7-alpine + +# Wersja i data builda jako build-arg +ARG APP_VERSION=unknown +ARG BUILD_DATE=unknown + +# Ustawiamy zmienne w ENV, by były dostępne w kontenerze +ENV APP_VERSION=$APP_VERSION +ENV BUILD_DATE=$BUILD_DATE + WORKDIR /app + COPY api . + +RUN apk add --no-cache curl RUN pip install -r requirements.txt -CMD python3 app.py + +CMD python3 app.py \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4717f40..b3d8e0c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,9 +7,24 @@ services: build: . env_file: - api/.env + ports: + - 80:80 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost/health"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 15s db: container_name: db hostname: db image: mysql:latest env_file: - db/.env + ports: + - 3306:3306 + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] + interval: 10s + timeout: 5s + retries: 5 \ No newline at end of file