Docker multi-container and flask skeleton with Flask + MySQL + uWSGI + Nginx
In order to make it work you need Docker & Docker Compose
Once you've your docker environment ready, clone this repo
git clone https://github.com/0x13a/docker-flask && cd docker-flask
Well, now you have to configure your MySQL server credentials, port & address here in the docker-compose.yml
db:
image: mysql
ports:
- 127.0.0.1:3306:3306
networks:
- appnet
volumes:
- "./.data/db:/var/lib/mysql"
environment:
MYSQL_ROOT_PASSWORD: changeThisSecretPasswordHere
You have to configure your project dependencies as well here in the src/requirements.txt
eg.
Flask==0.8
Jinja2==2.6
requests==0.11.1
Build your docker multicontainer
docker-compose build
Run your docker multicontainer
docker-compose up -d
Now your Flask app is ready and running at http://localhost
Learn more at https://docs.docker.com/compose/