add base web + change a container
This commit is contained in:
8
web/Dockerfile
Normal file
8
web/Dockerfile
Normal 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
17
web/app.py
Normal 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
12
web/view/index.html
Normal 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>
|
||||
Reference in New Issue
Block a user