feat: dockerize app

This commit is contained in:
2024-12-02 00:35:03 +02:00
parent 2272170e5a
commit b3b8637f0e
12 changed files with 218 additions and 3 deletions

View File

@@ -0,0 +1,4 @@
__pycache__
*.pyc
.dockerignore
Dockerfile

View File

@@ -0,0 +1,17 @@
FROM python:3.9
WORKDIR /app
COPY Pipfile Pipfile.lock ./
RUN pip install pipenv && \
pipenv install --system --deploy && \
pip install flask-cors
# Create necessary directories for data storage
RUN mkdir -p /app/surveys/quiz
COPY . .
EXPOSE 5000
CMD ["flask", "run", "--host=0.0.0.0"]

View File

@@ -13,11 +13,13 @@ import secrets
import pandas as pd
import db_conf
from flask import send_file
from flask_cors import CORS
#from flask_mail import Mail, Message
#import firebase_admin
#from firebase_admin import credentials, firestore, initialize_app, firebase
app = Flask(__name__, static_folder='../frontend/build', static_url_path='/')
CORS(app) # Add this line
app.config['MYSQL_DATABASE_HOST'] = db_conf.host
app.config['MYSQL_DATABASE_USER'] = db_conf.user
app.config['MYSQL_DATABASE_PASSWORD'] = db_conf.password