add base web + change a container

This commit is contained in:
M1n-0
2025-04-14 10:48:11 +02:00
parent 7a7ad1e59d
commit 17c91e5fa4
5 changed files with 52 additions and 28 deletions

8
web/Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM python:3.11
WORKDIR /web
COPY . /web
RUN pip install flask flask_sqlalchemy pymysql
CMD ["python", "app.py"]

17
web/app.py Normal file
View File

@@ -0,0 +1,17 @@
# flask-app/app.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask import render_template
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://flaskuser:flaskpass@mariadb/flaskdb'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
@app.route('/')
def index():
return render_template('index.html')
if __name__ == '__main__':
app.run(host='0.0.0.0')

12
web/view/index.html Normal file
View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
Hello World!
<h1>Welcome to the GestHub Web Interface</h1>
</body>
</html>