diff --git a/Dockerfile b/Dockerfile index 4d8f801..2778af7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:slim RUN pip install flask COPY /beer/beer.py /beer.py -COPY /beer/static /static +COPY /beer/templates /templates COPY /beer/static /static EXPOSE 5000 diff --git a/beer/beer.py b/beer/beer.py index ae3ddb8..c7a11a1 100755 --- a/beer/beer.py +++ b/beer/beer.py @@ -27,9 +27,19 @@ def index(hours=None, minutes=None): return data @app.route('/favicon.ico') -def favicon(): - """ serve the favicon """ - return send_from_directory('static', 'favicon.ico') +def default_favicon(): + """ serve default favicon """ + return send_from_directory('static', 'clock-icon.png') + +@app.route('/favicon/') +def favicon(mode): + """ serve the favicon according to the timer """ + if mode == 'beer': + filename = 'beer-icon.png' + else: + filename = 'clock-icon.png' + + return send_from_directory('static', filename) def main(): """ main func """ diff --git a/beer/static/favicon.ico b/beer/static/beer-icon.png similarity index 100% rename from beer/static/favicon.ico rename to beer/static/beer-icon.png diff --git a/beer/static/clock-icon.png b/beer/static/clock-icon.png new file mode 100644 index 0000000..9848562 Binary files /dev/null and b/beer/static/clock-icon.png differ diff --git a/beer/templates/beer.html b/beer/templates/beer.html index 207c63c..7685d42 100644 --- a/beer/templates/beer.html +++ b/beer/templates/beer.html @@ -44,8 +44,23 @@ })();