Add Docker configuration files and update requirements

This commit is contained in:
2025-05-22 19:28:42 +02:00
parent 589b082190
commit a53d5b91fb
3 changed files with 26 additions and 11 deletions

View File

@@ -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"]
CMD ["flask", "run", "--host=0.0.0.0"]

13
docker-compose.yml Normal file
View File

@@ -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

View File

@@ -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
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