Add Docker configuration files and update requirements
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,5 +1,5 @@
|
|||||||
# Use an official Python runtime as a parent image
|
# Use an official Python runtime as a parent image
|
||||||
FROM python:3.11-slim
|
FROM python:3.10-slim
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
@@ -9,18 +9,18 @@ ENV PYTHONUNBUFFERED 1
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
COPY requirements.txt /app/
|
COPY requirements.txt .
|
||||||
RUN pip install --upgrade pip && pip install -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY . /app/
|
COPY . .
|
||||||
|
|
||||||
# Expose the port Flask runs on
|
# Expose the port Flask runs on
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
# Set environment variable for Flask
|
# Set environment variable for Flask
|
||||||
ENV FLASK_APP=app.py
|
ENV FLASK_APP=app.py
|
||||||
ENV FLASK_RUN_HOST=0.0.0.0
|
ENV FLASK_ENV=production
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
CMD ["flask", "run"]
|
CMD ["flask", "run", "--host=0.0.0.0"]
|
||||||
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal 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
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
Flask==2.3.3
|
Flask==2.3.3
|
||||||
Flask-SQLAlchemy==3.0.5
|
Flask-SQLAlchemy==3.1.1
|
||||||
SQLAlchemy==2.0.20
|
Flask-Login==0.6.2
|
||||||
python-dotenv==1.0.0
|
Flask-WTF==1.2.1
|
||||||
Flask-WTF==1.1.1
|
SQLAlchemy==2.0.23
|
||||||
Werkzeug==2.3.7
|
Werkzeug==2.3.7
|
||||||
|
WTForms==3.1.1
|
||||||
|
python-dotenv==1.0.0
|
||||||
Reference in New Issue
Block a user