From f0286d70131e1495a66b9d81be7e0b6d08c30aa8 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Wed, 3 Nov 2021 10:59:14 +0000 Subject: [PATCH] v3.0.1 update: Gunicorn and og meta tags --- Dockerfile | 2 +- README.md | 11 ++++++++--- interface/templates/base.html | 1 + interface/templates/og-meta.html | 17 +++++++++++++++++ requirements.txt | 1 + wsgi.py | 4 ++++ 6 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 interface/templates/og-meta.html create mode 100644 wsgi.py diff --git a/Dockerfile b/Dockerfile index ae7c666..3e7d588 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,4 +2,4 @@ FROM python:3.10-alpine WORKDIR /app COPY . . RUN pip install -r requirements.txt -CMD ["python","app.py"] \ No newline at end of file +CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"] \ No newline at end of file diff --git a/README.md b/README.md index 37fc44d..b455968 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,17 @@ This can be changed by amending the `docker-compose.yml` entry on `line 8` to: ## Version History -### Current Version: 3.0.0 (1 November 2021) +### Current Version: 3.0.1 (3 November 2021) ### Changelog +- Serving the web app using Gunicorn so it can handle multiple requests. +- Added OpenGraph and other social media meta tags to allow for sharing on social media. + +### Past Versions + +#### Version 3.0.0 + - Re-built the quiz to run on the server side rather than on the client. - Built using Python, Flask, Jinja, and html primarily. - Changed the layout to a cleaner, more accessible and modern style using the Bootstrap CSS framework, @@ -62,8 +69,6 @@ This can be changed by amending the `docker-compose.yml` entry on `line 8` to: - Refined the algorithm by which the Joined duplicates another playbook based on the second-highest scoring match rather than selecting a playbook entirely at random. - Dockerised the quiz and hosting it on my web server, serving it via the front-end reverse proxy. -### Past Versions - Because I only started using Git relatively recently, I have not uploaded the code from the older versions onto the repo. The repo starts with version 3. diff --git a/interface/templates/base.html b/interface/templates/base.html index eb901cd..2389dc0 100644 --- a/interface/templates/base.html +++ b/interface/templates/base.html @@ -25,6 +25,7 @@ {% block title %}{% endblock %} | Which Masks Playbook Are You? — a Personality Quiz + {% include "og-meta.html" %} diff --git a/interface/templates/og-meta.html b/interface/templates/og-meta.html new file mode 100644 index 0000000..4e3288e --- /dev/null +++ b/interface/templates/og-meta.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 1086595..e1c559c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ click==8.0.3 colorama==0.4.4 Flask==2.0.2 +gunicorn==20.1.0 itsdangerous==2.0.1 Jinja2==3.0.2 MarkupSafe==2.0.1 diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..3c1465a --- /dev/null +++ b/wsgi.py @@ -0,0 +1,4 @@ +from app import app + +if __name__ == '__main__': + app.run() \ No newline at end of file