Clean Up and fixing docker build

This commit is contained in:
Rsclub2 2 2023-10-18 15:04:53 +02:00
parent 5e5b0d55a1
commit eec6f31419
2 changed files with 2 additions and 3 deletions

View File

@ -3,6 +3,6 @@ WORKDIR /hafas_db
COPY Hafas_Main_web.py app.py COPY Hafas_Main_web.py app.py
RUN mkdir -p templates RUN mkdir -p templates
COPY templates templates/. COPY templates templates/.
RUN pip3 install Flask RUN pip3 install Flask requests
CMD ["python3", "app.py"] CMD ["python3", "app.py"]
EXPOSE 5000 EXPOSE 5000

View File

@ -11,7 +11,6 @@ def index():
if request.method == 'POST': if request.method == 'POST':
station_name = request.form.get('station_name', '') station_name = request.form.get('station_name', '')
if station_name: if station_name:
# Speichere den Stationsnamen im Cookie
url = f"https://dbf.finalrewind.org/{station_name}.json?version=3" url = f"https://dbf.finalrewind.org/{station_name}.json?version=3"
response = requests.get(url) response = requests.get(url)
@ -22,7 +21,7 @@ def index():
resp.set_cookie('station_name', station_name) resp.set_cookie('station_name', station_name)
return resp return resp
if station_name: # Überprüfe, ob ein Stationsname aus dem Cookie gelesen wurde if station_name:
url = f"https://dbf.finalrewind.org/{station_name}.json?version=3" url = f"https://dbf.finalrewind.org/{station_name}.json?version=3"
response = requests.get(url) response = requests.get(url)