Flask Dashboard - Execution with Docker
Tags: flask, dashboards, docker, appseed
Published: 2020-03-28 19:38:36

---
title: Flask Dashboard - Execution with Docker
published: true
description: A curated list with open-source flask dashboards configured with  Docker 
cover_image: https://raw.githubusercontent.com/app-generator/static/master/products/flask-dashboard-black-intro.gif
tags: flask, dashboards, docker, appseed
---

Hello Coders,

This article presents an open-source **[Flask Dashboard](https://appseed.us/admin-dashboards/flask-dashboard-black)** configured to run in **Docker**. The curious minds can download this sample directly from Github (no account required) and use it for hobby & commercial projects. For newcomers, Flask is a lightweight web application framework written in Python. Sometimes classified as a microframework, Flask provides a lightweight codebase that can be easily extended to become an API, a simple web app, or a complex eCommerce platform.

> *Thanks for reading!* - Content provided by **[App Generator](https://appseed.us/)**.

---

- ✨ [Flask Dashboard Black](https://appseed.us/admin-dashboards/flask-dashboard-black) - Product page
- ✨ [Flask Dashboard Black](https://flask-black-dashboard.appseed-srv1.com/) - LIVE Demo

---

To locally build and execute the Flask application used as a sample in this article { **[Flask Dashboard Black](https://appseed.us/admin-dashboards/flask-dashboard-black)** } is quite simple:

- Make sure you have a Python environment up & running
- Clone the open-source project
- Install the modules required by the app
- Prepare the environment by setting the `FLASK_APP` variable
- Start the app using the flask embedded server `flask run`

In our local environment, usually (not always) things are fairly simple and we will see the app running in the browser without much effort. The real issues might hit us hard when we want to release the app in the public space, using a production server. 

**Docker**, properly set up on top of our application should make this deployment much easier. A few advantages provided by this virtualization model:

- The App is executed isolated without damaging or interfering other apps or services
- The management layer (start/stop the app) is at Docker level now - super easy to manage 
- Multiply app instances by using multiple Docker containers with ease

Enough talking, let's see something beautiful on our screen executed with Docker, in less than two minutes. In case you don't have [Docker](https://www.docker.com/) installed in the workstation, please navigate to their [website](https://www.docker.com/) and follow the installation instructions suitable for your OS: [Mac](https://docs.docker.com/docker-for-mac/install/), [Linux](https://docs.docker.com/install/linux/docker-ce/ubuntu/) (Ubuntu) or [M$ Windows](https://docs.docker.com/docker-for-windows/install/) and get back here when it's done. 

The [Flask Dashboard](https://appseed.us/admin-dashboards/flask-dashboard-black) used a sample is an open-source admin panel coded on top of a beautiful Black Design crafted by **Creative-Tim** agency. 

---

## [Flask](https://flask.palletsprojects.com/) Dashboard - [Docker](https://www.docker.com/) execution 

> Get the code

```bash
$ git clone https://github.com/app-generator/flask-black-dashboard.git
$ cd flask-black-dashboard
```

> Install Docker modules (Nginx, Gunicorn)

```bash
$ sudo docker-compose pull
```
 
> Set up the app inside the Docker container

```bash
$ sudo docker-compose build
```

> Start the Docker container

```bash
$ sudo docker-compose up 
```

Visit `http://localhost:5005` in your browser. You should see a nice screen like this one: 

![Flask Dashboard Black - Executed in Docker](https://raw.githubusercontent.com/app-generator/static/master/products/flask-dashboard-black-screen.png)

We can see that the usual steps to install the modules, set up the environment and configure Gunicorn to exec the app, has gone. To make this happen, this app has already some useful files configured to make our lives easier, thanks to Docker. 

---

### What happens under the hood

- Docker pull the images for Nginx and Gunicorn
- The Python modules required by the app are installed inside the container
- The environment is updated with necessary variables
- Start the app using Gunicorn 
- Start Nginx and link the proxy server to our app 
- Expose the port 5005 outside container 

> Relevant files

- [docker-compose.yml](https://github.com/app-generator/flask-black-dashboard/blob/master/docker-compose.yml) the file that orchestrates all layers
- [Dockerfile](https://github.com/app-generator/flask-black-dashboard/blob/master/Dockerfile) - responsible to setup the app
- [gunicorn-cfg.py](https://github.com/app-generator/flask-black-dashboard/blob/master/gunicorn-cfg.py) - Gunicorn configuration
- [nginx-conf](https://github.com/app-generator/flask-black-dashboard/blob/master/nginx/appseed-app.conf) - Nginx Proxy configuration

---

### Other Useful commands

> Start the container - daemon mode

The previous command `sudo docker-compose up` will lock the terminal. In case we want to execute the container as a background process `-d` must be used as an argument. 

```bash
$ docker-compose up -d
``` 

> Stop the Docker container

```bash
$ docker-compose down 
```

Personally, I found Docker super convenient for Python-based apps deployment (e.g Flask & Django apps) and to make my life easier, I've cloned this set up for more free & open source **Flask Dashboards**, listed below:

---

## [Flask Dashboard Argon](https://appseed.us/admin-dashboards/flask-boilerplate-dashboard-argon) 

An open-source admin panel coded in **Flask** on top of Argon Dashboard design (free version) - UI Credit Creative-Tim. 

> Use with Docker 

```bash
$ # Clone the sources
$ git clone https://github.com/app-generator/flask-boilerplate-dashboard-argon.git
$ cd flask-boilerplate-dashboard-argon
$
$ # Start the app in Docker
$ docker-compose pull && docker-compose build && docker-compose up
```

![Flask Dashboard Argon - Open-Source Flask Boilerplate.](https://raw.githubusercontent.com/app-generator/static/master/products/flask-boilerplate-dashboard-argon-screen.png)

---

## [Flask Dashboard Atlantis Dark](https://appseed.us/admin-dashboards/flask-dashboard-atlantis-dark)

A super simple open-source admin dashboard coded in Flask Framework on top of Atlantis Dark Dashboard design (free version). 

> Use with Docker 

```bash
$ # Clone the sources
$ git clone https://github.com/app-generator/flask-dashboard-atlantis-dark.git
$ cd flask-dashboard-atlantis-dark
$
$ # Start the app in Docker
$ docker-compose pull && docker-compose build && docker-compose up
```

![Flask Dashboard Atlantis Dark - Open-Source Flask Dashboard.](https://raw.githubusercontent.com/app-generator/static/master/products/flask-dashboard-atlantis-dark-screen.png)

--- 

## [Flask Dashboard Light Blue](https://appseed.us/admin-dashboards/flask-dashboard-light-blue)

Free admin dashboard designed by FlatLogic and coded in Flask. 

> Use with Docker 

```bash
$ # Clone the sources
$ git clone https://github.com/app-generator/flask-dashboard-light-blue.git
$ cd flask-dashboard-light-blue
$
$ # Start the app in Docker
$ docker-compose pull && docker-compose build && docker-compose up
```

![Flask Dashboard Light Blue - Open-Source Dashboard.](https://raw.githubusercontent.com/app-generator/static/master/products/flask-dashboard-light-blue-screen.png)

---

## [Flask Dashboard Now UI](https://appseed.us/admin-dashboards/flask-dashboard-nowui-design)

A super nice Dashboard design coded in Flask - MIT License. 

> Start with Docker 

```bash
$ # Clone the sources
$ git clone https://github.com/app-generator/flask-now-ui-dashboard.git
$ cd flask-now-ui-dashboard
$
$ # Start the app in Docker
$ docker-compose pull && docker-compose build && docker-compose up
```

![Flask Dashboard Now UI - Open-Source Flask Dashboard.](https://raw.githubusercontent.com/app-generator/static/master/products/flask-dashboard-nowui-design-screen.png)

--- 

Well, that's all coders. For more free, [open-source admin dashboards](https://appseed.us/admin-dashboards/open-source) please access the [AppSeed](https://appseed.us) platform or [Github](https://github.com/app-generator/admin-dashboards). 

---
 
> Credits & Resources 

## [Flask Framework](https://www.palletsprojects.com/p/flask/)

[Flask](https://docs.appseed.us/content/what-is/flask) is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions.

## [Docker](https://www.docker.com/)

Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package.

---

> **Thanks for reading!** For more resources, feel free to access:

- 👉 More [Flask Dashboards](https://appseed.us/admin-dashboards/flask/) crafted in Django, Flask, and `React`
- 👉 More [Flask Apps](https://appseed.us/apps/flask/) - free & PAID