|
|
@@ -52,13 +52,12 @@ $
|
|
|
$ # Virtualenv modules installation (Windows based systems)
|
|
|
$ # virtualenv --no-site-packages env
|
|
|
$ # .\env\Scripts\activate
|
|
|
-$
|
|
|
-$ # Install modules
|
|
|
-$ # SQLIte version (no PostgreSQL)
|
|
|
-$ pip3 install -r requirements-sqlite.txt
|
|
|
-$
|
|
|
+$
|
|
|
+$ # Install modules - SQLite Database
|
|
|
+$ pip3 install -r requirements.txt
|
|
|
+$
|
|
|
$ # OR with PostgreSQL connector
|
|
|
-$ pip install -r requirements.txt
|
|
|
+$ # pip install -r requirements-pgsql.txt
|
|
|
$
|
|
|
$ # Set the FLASK_APP environment variable
|
|
|
$ (Unix/Mac) export FLASK_APP=run.py
|
|
|
@@ -80,9 +79,16 @@ $ # Access the dashboard in browser: http://127.0.0.1:5000/
|
|
|
|
|
|
<br />
|
|
|
|
|
|
-## Docker execution
|
|
|
+## Deployment
|
|
|
|
|
|
-The application can be easily excuted in a docker container. The steps:
|
|
|
+The app is provided with a basic configuration to be executed in [Docker](https://www.docker.com/), [Gunicorn](https://gunicorn.org/), and [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/).
|
|
|
+
|
|
|
+<br />
|
|
|
+
|
|
|
+### [Docker](https://www.docker.com/) execution
|
|
|
+---
|
|
|
+
|
|
|
+The application can be easily executed in a docker container. The steps:
|
|
|
|
|
|
> Get the code
|
|
|
|
|
|
@@ -97,7 +103,50 @@ $ cd flask-material-dashboard
|
|
|
$ sudo docker-compose pull && sudo docker-compose build && sudo docker-compose up -d
|
|
|
```
|
|
|
|
|
|
-Visit `http://localhost:5000` in your browser. The app should be up & running.
|
|
|
+Visit `http://localhost:5005` in your browser. The app should be up & running.
|
|
|
+
|
|
|
+<br />
|
|
|
+
|
|
|
+### [Gunicorn](https://gunicorn.org/)
|
|
|
+---
|
|
|
+
|
|
|
+Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX.
|
|
|
+
|
|
|
+> Install using pip
|
|
|
+
|
|
|
+```bash
|
|
|
+$ pip install gunicorn
|
|
|
+```
|
|
|
+> Start the app using gunicorn binary
|
|
|
+
|
|
|
+```bash
|
|
|
+$ gunicorn --bind 0.0.0.0:8001 run:app
|
|
|
+Serving on http://localhost:8001
|
|
|
+```
|
|
|
+
|
|
|
+Visit `http://localhost:8001` in your browser. The app should be up & running.
|
|
|
+
|
|
|
+
|
|
|
+<br />
|
|
|
+
|
|
|
+### [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/)
|
|
|
+---
|
|
|
+
|
|
|
+Waitress (Gunicorn equivalent for Windows) is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones that live in the Python standard library.
|
|
|
+
|
|
|
+> Install using pip
|
|
|
+
|
|
|
+```bash
|
|
|
+$ pip install waitress
|
|
|
+```
|
|
|
+> Start the app using [waitress-serve](https://docs.pylonsproject.org/projects/waitress/en/stable/runner.html)
|
|
|
+
|
|
|
+```bash
|
|
|
+$ waitress-serve --port=8001 run:app
|
|
|
+Serving on http://localhost:8001
|
|
|
+```
|
|
|
+
|
|
|
+Visit `http://localhost:8001` in your browser. The app should be up & running.
|
|
|
|
|
|
<br />
|
|
|
|