start dynamic structure in settings
This commit is contained in:
parent
e7e042f3c7
commit
5b4390b6b7
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
|||||||
/__pycache__
|
/__pycache__
|
||||||
/access_log.db
|
/access_log.db
|
||||||
/folder_config.json
|
/folder_config.json
|
||||||
|
/.env
|
||||||
4
app.py
4
app.py
@ -377,7 +377,9 @@ def handle_request_initial_data():
|
|||||||
@app.route('/<path:path>')
|
@app.route('/<path:path>')
|
||||||
@auth.require_secret
|
@auth.require_secret
|
||||||
def index(path):
|
def index(path):
|
||||||
return render_template("app.html")
|
title_short = os.environ.get('TITLE_SHORT', 'Default Title')
|
||||||
|
title_long = os.environ.get('TITLE_LONG', 'Default Title')
|
||||||
|
return render_template("app.html", title_short=title_short, title_long=title_long)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
socketio.run(app, debug=True, host='0.0.0.0')
|
socketio.run(app, debug=True, host='0.0.0.0')
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
flask-app:
|
flask-app:
|
||||||
image: python:3.11-slim
|
image: python:3.11-slim
|
||||||
container_name: bethaus-app
|
container_name: "${CONTAINER_NAME}"
|
||||||
restart: always
|
restart: always
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
volumes:
|
volumes:
|
||||||
@ -17,25 +17,27 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- FLASK_APP=app.py
|
- FLASK_APP=app.py
|
||||||
- FLASK_ENV=production
|
- FLASK_ENV=production
|
||||||
|
- TITLE_SHORT=${TITLE_SHORT}
|
||||||
|
- TITLE_LONG=${TITLE_LONG}
|
||||||
networks:
|
networks:
|
||||||
- traefik
|
- traefik
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
|
|
||||||
# HTTP router (port 80), redirecting to HTTPS
|
# HTTP router (port 80), redirecting to HTTPS
|
||||||
- "traefik.http.routers.bethaus-app.rule=Host(`app.bethaus-speyer.de`)"
|
- "traefik.http.routers.${CONTAINER_NAME}.rule=${HOST_RULE}"
|
||||||
- "traefik.http.routers.bethaus-app.entrypoints=web"
|
- "traefik.http.routers.${CONTAINER_NAME}.entrypoints=web"
|
||||||
- "traefik.http.routers.bethaus-app.middlewares=redirect-to-https"
|
- "traefik.http.routers.${CONTAINER_NAME}.middlewares=redirect-to-https"
|
||||||
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
||||||
|
|
||||||
# HTTPS router (TLS via Let's Encrypt)
|
# HTTPS router (TLS via Let's Encrypt)
|
||||||
- "traefik.http.routers.bethaus-app-secure.rule=Host(`app.bethaus-speyer.de`)"
|
- "traefik.http.routers.${CONTAINER_NAME}-secure.rule=${HOST_RULE}"
|
||||||
- "traefik.http.routers.bethaus-app-secure.entrypoints=websecure"
|
- "traefik.http.routers.${CONTAINER_NAME}-secure.entrypoints=websecure"
|
||||||
- "traefik.http.routers.bethaus-app-secure.tls=true"
|
- "traefik.http.routers.${CONTAINER_NAME}-secure.tls=true"
|
||||||
- "traefik.http.routers.bethaus-app-secure.tls.certresolver=myresolver"
|
- "traefik.http.routers.${CONTAINER_NAME}-secure.tls.certresolver=myresolver"
|
||||||
|
|
||||||
# Internal port
|
# Internal port
|
||||||
- "traefik.http.services.bethaus-app.loadbalancer.server.port=5000"
|
- "traefik.http.services.${CONTAINER_NAME}.loadbalancer.server.port=5000"
|
||||||
|
|
||||||
# Production-ready Gunicorn command with eventlet
|
# Production-ready Gunicorn command with eventlet
|
||||||
command: >
|
command: >
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
<meta property="og:image" content="https://app.bethaus-speyer.de/static/icons/logo-200x200.png" />
|
<meta property="og:image" content="https://app.bethaus-speyer.de/static/icons/logo-200x200.png" />
|
||||||
<meta property="og:url" content="https://app.bethaus-speyer.de" />
|
<meta property="og:url" content="https://app.bethaus-speyer.de" />
|
||||||
|
|
||||||
<title>Gottesdienste</title>
|
<title>{{ title_short }}</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<meta name="description" content="... uns aber, die wir gerettet werden, ist es eine Gotteskraft.">
|
<meta name="description" content="... uns aber, die wir gerettet werden, ist es eine Gotteskraft.">
|
||||||
<meta name="author" content="Bethaus Speyer">
|
<meta name="author" content="Bethaus Speyer">
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<a href="#">
|
<a href="#">
|
||||||
<img src="/static/logoW.png" alt="Logo" class="logo">
|
<img src="/static/logoW.png" alt="Logo" class="logo">
|
||||||
</a>
|
</a>
|
||||||
<h1>Gottesdienste Speyer und Schwegenheim</h1>
|
<h1>{{ title_long }}</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user