Git Product home page Git Product logo

gunicorn-nginx-example's Introduction

Goal

I have failed numerous times over the years to get Flask, gunicorn, and NGINX working together. I will give it another go. Below is the order of how I think things should be done to keep things simple.

TODO

  • Get Python and Flask installed in a container
  • Get Flask working with gunicorn
  • Get gunicorn working in a container
  • Start implementing docker-compose
  • Finally, introduce NGINX
  • Get this working on AWS with a default IP
  • [ ] Get NGINX working on https, port 443
  • [ ] Create an AMI
  • [ ] Get this working on AWS with a subdomain
  • [ ] Create an EC2 with docker and docker-compose. Then you can probably launch it every time the server startes with user_data

^ It's a bit more subtle here. You want docker to be able to automatically run in two scenarios.

  1. Every time a new sever is spun up based off an image. (this is the same as the TODO above - user_data is only executed when an AMI launches)
  2. Anytime the server crashes and reboots itself. I first found out about this in this post. It suggests using something called systemctl

Docker usage

Locally

docker-compose up -d --build --scale app=3

On EC2

WIP, but for now

  1. Create a new EC2 from scratch (TODO: create an AMI)
  2. Manually install git, docker, docker-compose and this repo (TODO: I believe an AMI also solves this)
  3. Manually set the correct user permissions for the above services and start the services (TODO: I believe an AMI also solves this)
  4. Set docker-compose up so that if it crashes it automatically reboots
  5. Figure out the correct commands for user_data and spin up a new EC2 to test

gunicorn-nginx-example's People

Contributors

jakemcannon avatar

Watchers

 avatar  avatar

Forkers

andressahelum

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.