From a073b0911559c6f55fcf4dd64d432eaeb268cedb Mon Sep 17 00:00:00 2001 From: marwin Date: Sun, 20 Apr 2025 19:22:08 +0100 Subject: [PATCH] Update Docker configuration: change Docker Compose version to 3.8, enhance web service setup with context and dockerfile specifications, add volume and environment variables for Flask development, and modify Dockerfile to use Python 3.11 and improve file copying and command execution. --- Dockerfile | 12 +++++++----- docker-compose.yml | 14 +++++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5780a0b..a786bd4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ -FROM python:3.9-slim-buster +FROM python:3.11-slim WORKDIR /app -COPY requirements.txt requirements.txt -RUN pip install -r requirements.txt +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt -COPY website . +COPY . . -CMD ["python", "app.py"] \ No newline at end of file +EXPOSE 5000 + +CMD ["python", "website/app.py"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c2faf8f..7fa6c8a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,15 @@ -version: "3.9" +version: '3.8' + services: web: - build: . + build: + context: . + dockerfile: Dockerfile ports: - "5000:5000" - restart: always \ No newline at end of file + volumes: + - .:/app + environment: + - FLASK_ENV=development + - FLASK_DEBUG=1 + command: python website/app.py \ No newline at end of file