Code Monkey home page Code Monkey logo

connections's Introduction

connections demo

A demo app showing a simple service using flask and some supporting packages

Requirements

  • Docker CE >= 17.04

Stack Information

  • python flask
  • pipenv (for package management rather than virtualenv capabilities)
  • mysql
  • nginx + gunicorn

All API calls will go through nginx at http://localhost:5000. All the other services are handled within Docker's internal network and no other ports are exposed to the host machine.

Instructions

  • Build and kick off all the services with docker-compose.
docker-compose up -d --build

You can omit -d if you want to run it in the foreground and dump all logs from all containers into your terminal. Alternatively you can use docker logs <container name> -f to tail logs from a specific container.

You can use docker ps command to see the running containers. You should see 4 running containers. ** Don't forget to run the migrations provided in the next section.**

The folders connections/ and /migrations are mounted from the host to the container. Any changes made from the host will propagate to the container and vice versa.

MySQL database creates its own volume that provides persistence in the case of rebuilding/restarting/stopping the containers. Those volumes are managed by Docker and not directly exposed to the developer.

Other useful commands for stopping, starting and restarting the services.

docker-compose stop | start | restart
  • Migrate the database
docker-compose exec connections flask db upgrade
  • Run tests
docker-compose exec connections pytest
  • Lint code for style violations
docker-compose exec connections flake8 .

connections's People

Contributors

stewbawka avatar

Watchers

 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.