From a53d5b91fb01f58f86a9c3514942bd5fc70cc5cc Mon Sep 17 00:00:00 2001 From: Kobe Date: Thu, 22 May 2025 19:28:42 +0200 Subject: [PATCH] Add Docker configuration files and update requirements --- Dockerfile | 12 ++++++------ docker-compose.yml | 13 +++++++++++++ requirements.txt | 12 +++++++----- 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index e819671..96ee7e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use an official Python runtime as a parent image -FROM python:3.11-slim +FROM python:3.10-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 @@ -9,18 +9,18 @@ ENV PYTHONUNBUFFERED 1 WORKDIR /app # Install dependencies -COPY requirements.txt /app/ -RUN pip install --upgrade pip && pip install -r requirements.txt +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt # Copy project files -COPY . /app/ +COPY . . # Expose the port Flask runs on EXPOSE 5000 # Set environment variable for Flask ENV FLASK_APP=app.py -ENV FLASK_RUN_HOST=0.0.0.0 +ENV FLASK_ENV=production # Run the application -CMD ["flask", "run"] \ No newline at end of file +CMD ["flask", "run", "--host=0.0.0.0"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7267ddf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' + +services: + web: + build: . + ports: + - "5000:5000" + environment: + - FLASK_APP=app.py + - FLASK_ENV=production + volumes: + - .:/app + restart: unless-stopped \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 820c940..f368d53 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,8 @@ Flask==2.3.3 -Flask-SQLAlchemy==3.0.5 -SQLAlchemy==2.0.20 -python-dotenv==1.0.0 -Flask-WTF==1.1.1 -Werkzeug==2.3.7 \ No newline at end of file +Flask-SQLAlchemy==3.1.1 +Flask-Login==0.6.2 +Flask-WTF==1.2.1 +SQLAlchemy==2.0.23 +Werkzeug==2.3.7 +WTForms==3.1.1 +python-dotenv==1.0.0 \ No newline at end of file