Skip to content

Sample code of my experiment task, which is running flask app and mosquitto broker inside docker container.

Notifications You must be signed in to change notification settings

whyuhurtz/simple-docker-flask-mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Docker Flask Mqtt

Softwares

  • Flask app : Mqtt Publisher
  • Mosquitto : Mqtt Broker/Server
  • ESP8266Client : Mqtt Subscriber

Requirements

You just need this 2 softwares:

  • Docker Engine, and
  • Docker Compose.

More detail of docker installation: https://docs.docker.com/engine/install/

Usage

If you're on Linux/Mac environment, just copy this following command:

chmod a+x run.sh && sudo bash run.sh

But, if you on Windows, just type the manual command (I recommend to use Git Bash):

docker-compose up -d --build

Don't forget to upload esp8266 code to your own device. Also, change these variables to your own WiFi and Mqtt configuration:

const char* ssid = "xxxxxxxxxxxx";
const char* pass = "xxxxxxxxxxxx";
const char* mqtt_server = "192.168.1.x";
const int mqtt_port = 11884;
const char* sub_topic = "flask/mqtt";

Thank's

About

Sample code of my experiment task, which is running flask app and mosquitto broker inside docker container.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published