GithubHelp home page GithubHelp logo

wesbarnett / flask-project Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 4.21 MB

Flask server with a Github workflow that uses Ansible to continuosly update a deployment

Python 30.61% Dockerfile 38.16% Shell 31.24%

flask-project's Introduction

flask project

Barebones flask project that continuously deploys to an AWS EC2 instance using Github actions and Ansible.

Setup

Generate a new repository based on this one by clicking here.

A PR will be opened in your repository a few minutes after you generate the repository, outlining the next steps. Essentially you will generate a keypair, store private key in Github and the public on AWS, provision your EC2 instance, update your domain's A record to point to it, and then update one configuration file.

Continuous deployment

Every time a push is made to the default branch main, the Github Action that updates your EC2 instance will run. In other words, you should make development changes in another branch, test them, and when satisfied they are ready for production, merge them into your default branch and push to Github.

To add other Python packages to your deployment, update the requirements.txt.

Run locally

To run with gunicorn do:

gunicorn --chdir application -b :8080 app:app

Then visit http://localhost:8080.

References

I found this repository helpful in setting up Ansible for use with Github workflows and actions and just want to give a shout out to it.

I was also inspired by the work done by fastpages which uses Github workflows and actions to automatically update Github pages. I definitely looked at several of their files and borrowed some of their ideas!

See also

See the original blog post here with further details on these instructions.

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.