GithubHelp home page GithubHelp logo

dockerizingflaskandpostgres's Introduction

docker_flask_postgres

alt tag

In this exercise we use docker for provide a environmnt like the showed in the imagen 1: A ubuntu machine with a microframework and a database in postgres.

The version of docker used for this exercise is 1.12.3 (as showed in the image), the docker image used was the ubuntu:14.04 and the host machine was a ubuntu 14.04 with the next specifications.

  • 8GB of RAM
  • Intel Core i7

We implement 2 virtual containers:

  • flask: in this container, we install the microframework Flask, we configure the container to execute a service in the port 5000. This microservice has 3 URL's:

    1. http://localhost:5000/ -> this url show all the information storage in the table "word" in the postgres database.
    2. http://localhost:5000/test -> this url add information to the database, in this case added a static text "Mi Primera Palabra".
    3. http://localhost:5000/parametro -> this url added the text inserted in the url, for example "http://localhost:5000/hola" added the text "hola" in the database.
  • postgres: in this, we install the postgres database, we configure the schema, the ports to expose, we indicated which clients are allowed to authenticated to the database and we configure the start of the services.

To run this exercise, clone this repository and realize the "docker-compose up -d" command, be sure that you have in your docker images an image of ubuntu:14:04 updated. If the process end succesfully you will be able to consult any of the 3 url exposed by flask. In other cases you have to check in your configurations allow you to created this environment.

For this exercise, we built the images previously and then we call it flaskmachine:latest (for the machine builded with the Dockerfile in the folder flaskBaseImage).

For this exercise, we built the images previously and then we call it postgresmachine:latest (for the machine builded with the Dockerfile in the folder postgresBaseImage)

Video:

  • put the link video here

developed by: *yorjaggy edicion16

dockerizingflaskandpostgres's People

Contributors

yorjaggy avatar

Stargazers

Vagdevi Kommineni avatar Maove avatar

Watchers

James Cloos avatar  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.