Code Monkey home page Code Monkey logo

python-flask-mongodb's Introduction

Initial Development Environment to work with Python, Flask and MongoDB

It uses Docker-compose: Compose is a tool for defining and running complex applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.

https://docs.docker.com/compose/install/

After installing Docker and Docker-compose on your machine, you can go to the project main folder and type:

$sudo docker-compose up

Docker-compose will build the containers necessary for your environment. Basically there will be two containers, one with Python, Flask and a few modules and another container with MongoDB bound to the first. The environment structure is as follow:

app/

(You need to create a directory /app in your local harddrive. This is where you will keep your app.py Flask file for development.)

data/

Dockerfiles/

docker-compose-yml

Within the app folder, there is an app.py file which is file that starts Flask.

This app.py file is shared with the container, so if you edit it locally on your machine, it will reflect on the container which is running Flask on port 5000.

If everything works fine, you should be able to connect to a simple page (Hello World) at:

http://localhost:5000

the other folders are necessary for:

data -> mongodb folder (shared with Mongo's Container)

Dockerfiles -> the Dockerfiles which create the containers, any change on each container can be done by editing these files

docker-compose-yml -> is the orquestrator that starts building the containers and link them up.

python-flask-mongodb's People

Contributors

ivoreali avatar hellor00t avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.