diff --git a/.gitignore b/.gitignore index 22310fd..034cae1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ __pycache__/ *.so .idea +postgres_data # Distribution / packaging .Python diff --git a/app.py b/app.py index 0862e53..3498558 100644 --- a/app.py +++ b/app.py @@ -1,11 +1,11 @@ -from flask import Flask +from flask import Flask, render_template, request app = Flask(__name__) @app.route('/') def hello_world(): # put application's code here - return 'Hello World!' + return render_template("index.html") if __name__ == '__main__': diff --git a/docker-compose.yaml b/docker-compose.yaml index 10ceb03..034330b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,3 +12,23 @@ services: environment: - FLASK_APP=app.py - FLASK_ENV=development + - DATABASE_URL=postgresql://flaskuser:flaskpass@db:5432/flaskdb + depends_on: + - db + restart: unless-stopped + + db: + image: postgres:15 + container_name: postgres_db + restart: unless-stopped + environment: + - POSTGRES_USER=flaskuser + - POSTGRES_PASSWORD=flaskpass + - POSTGRES_DB=flaskdb + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..b89b586 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,19 @@ + + +
+ + + + +Zurücklehnen und genießen...
+ + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..7b7d76d --- /dev/null +++ b/templates/index.html @@ -0,0 +1,5 @@ +{% extends 'base.html' %} + +{% block title %} + HURENSOHN +{% endblock %} \ No newline at end of file