fix: remove url variables; docs: updated to current

This commit is contained in:
ahoemann 2025-03-21 08:36:35 +01:00
parent d74916f2c7
commit 40306538ba
4 changed files with 22 additions and 14 deletions

View file

@ -3,28 +3,41 @@
## Setting up the environment
1. Create a virtual environment:
```sh
python3 -m venv .venv
```
2. Activate the virtual environment:
```sh
. .venv/bin/activate
```
3. Install dependencies:
```sh
pip install requirements.txt
```
4. Set the environment variables:
```sh
export GIT_URL=http://git.adrianux.net
export WEBSITE_URL=http://adrianux.net
export DEBUGMODE=False
```
Or source the .env file:
```sh
cp .env.example .env # change the variables to suit your environment as needed
```
```sh
. .env
```
5. Run the app:
```sh
waitress-serve --listen=0.0.0.0:8080 app:app
```
@ -34,10 +47,9 @@ waitress-serve --listen=0.0.0.0:8080 app:app
## Building the container
```sh
docker build -t adrianux:latest - < latest.dockerfile
docker build -t adrianux:latest .
```
## Running the container
```sh

7
app.py
View file

@ -1,9 +1,6 @@
#!/usr/bin/env python3
from flask import Flask, render_template, redirect, url_for
from concurrent.futures import ThreadPoolExecutor
import requests
import os
import time
app = Flask(__name__)
@ -18,10 +15,12 @@ def about():
@app.route("/")
def homepage():
return render_template("homepage.j2", MONITORING_URL = os.environ['MONITORING_URL'], GIT_URL = os.environ['GIT_URL'])
return render_template("homepage.j2")
if __name__ == "__main__":
GIT_URL = os.environ['GIT_URL']
MONITORING_URL = os.environ['MONITORING_URL']
app.run(debug=os.environ['DEBUG_MODE'])

View file

@ -5,9 +5,6 @@
dockerfile: "Dockerfile"
container_name: "adrianux"
image: "adrianux:latest"
environment:
- "GIT_URL=http://git.adrianux.net"
- "MONITORING_URL=http://adrianux.net"
- "DEBUG_MODE=False"
env_file: .env
ports:
- "127.0.0.1:8080:8080"

View file

@ -14,8 +14,8 @@
<li><a href="/">Homepage</a></li>
<li><a href="imprint">Imprint</a></li>
<li><a href="about">About</a></li>
<li><a href="{{ MONITORING_URL }}">Monitoring</a></li>
<li><a href="{{ GIT_URL }}">Git</a></li>
<li><a href="https://cloud.adrianux.net">Monitoring</a></li>
<li><a href="https://git.adrianux.net">Git</a></li>
</ul>
</nav>
<body>