{"id":21374970,"url":"https://github.com/aoxborrow/fvang","last_synced_at":"2025-07-13T09:32:22.358Z","repository":{"id":141239542,"uuid":"45007163","full_name":"aoxborrow/fvang","owner":"aoxborrow","description":"Flask-Vagrant-Ansible-Nginx-Gunicorn Starter Pack","archived":false,"fork":false,"pushed_at":"2019-08-20T21:46:55.000Z","size":47,"stargazers_count":31,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-01-22T20:17:23.306Z","etag":null,"topics":["ansible","flask","gunicorn","nginx","python","python3","vagrant"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aoxborrow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-10-27T00:41:51.000Z","updated_at":"2024-01-22T20:17:32.639Z","dependencies_parsed_at":"2024-01-22T20:27:53.042Z","dependency_job_id":null,"html_url":"https://github.com/aoxborrow/fvang","commit_stats":null,"previous_names":["aoxborrow/fvang"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoxborrow%2Ffvang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoxborrow%2Ffvang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoxborrow%2Ffvang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoxborrow%2Ffvang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aoxborrow","download_url":"https://codeload.github.com/aoxborrow/fvang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225869908,"owners_count":17537169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","flask","gunicorn","nginx","python","python3","vagrant"],"created_at":"2024-11-22T08:46:17.790Z","updated_at":"2024-11-22T08:46:18.418Z","avatar_url":"https://github.com/aoxborrow.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"FVANG\n=======\n\n### Flask-Vagrant-Ansible-Nginx-Gunicorn *Starter Pack*\n\nThis is a starter pack for quickly developing a new Flask project locally with Vagrant, which is then easily deployed into production with Ansible. It installs and configures all the services you'll need:\n - **Vagrant** VM based on **Ubuntu 18.04**\n - **Python 3.6** virtualenv for your **Flask** app and its dependencies\n - **Nginx** to serve static files and proxy to **Gunicorn**\n - **Supervisor** to automatically start/restart Gunicorn\n - **Node.js** for installing front-end components *(optional)*\n\n### Features\n- Disposable environment is fully self-contained within the Vagrant VM\n- Ansible playbooks for both local development and production\n- Develop with Flask dev server, then test/deploy with Gunicorn/Nginx\n- Easily add Ansible galaxy roles *(ansible/requirements.yml)*\n- Activates Python virtualenv on login\n- Installs Python packages from `requirements.txt`\n- Installs Node packages from `package.json`\n\n### Shortcuts\n- `activate` - activate the virtualenv \n- `deactivate` - deactivate the virtualenv \n- `make run` - run Flask development server \n- `make restart` - start/restart Gunicorn \u0026 Nginx\n- `make provision-dev` - run playbook for dev *(must deactivate virtualenv)*\n- `make provision-prod` - run playbook production *(must deactivate virtualenv)*\n----\n\n### Local Development\n\n0. Install [Vagrant](https://www.vagrantup.com/)\n\n0. Clone this repo as your project name: **(This is important, the project folder name will be used for configuring hostname, etc.)**\n    ```sh\n    git clone git@github.com:paste/fvang.git my-project-name\n    ```\n\n0. Build your Vagrant VM:\n\n    ```sh\n    vagrant up\n    ```\n\n0. Log into the VM via SSH:\n    ```sh\n    vagrant ssh\n    ```\n\n0. Start Flask development server:\n    ```sh\n    cd my-project-name\n    make run\n    ```\n\n0. Modify your computer's local `/etc/hosts`:\n\n    ```\n    192.168.33.11   my-project-name.local\n    ```\n\n0. Visit your app:\n    ```\n    http://my-project-name.local\n    ```\n\n\n0. **Profit** :heavy_check_mark:\n\n\n----\n\n### In Production\n\n0. You'll need a remote user with `sudo` privileges to run Ansible.\n\n0. Edit the `host_name` and other settings in `ansible/prod.yml` as necessary.\n\n0. Clone your project onto the server in your remote user's home folder, e.g. `~/my-project-name`\n\n0. Install Ansible with the included script:\n    ```sh\n    cd ~/my-project-name\n    sudo ansible/install.sh\n    ```\n\n0. Install Ansible Galaxy roles:\n    ```sh\n    make install-galaxy-roles\n    ```\n\n0. Run the Ansible production playbook:\n    ```sh\n    make provision-prod\n    ```\n\n0. **Profit** :heavy_check_mark:\n\n\n----\n\n### HTTPS in Production\n\n0. To use HTTPS you will need an SSL certificate. Get one from Certbot here: https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx\n\n0. Copy the certificate and key to your remote user's home folder. The Nginx configuration expects the files to be named after the `host_name`, like this:  \n    ```\n    ~/fvang.io.crt\n    ~/fvang.io.key\n    ```\n\n0. Update the production playboook to use SSL, in `ansible/prod.yml`:  \n    ```yaml\n    nginx_use_ssl: true\n    ```\n\n0. Re-run the Ansible production playbook:\n    ```sh\n    make provision-prod\n    ```\n\n0. **Profit** :heavy_check_mark:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxborrow%2Ffvang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faoxborrow%2Ffvang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxborrow%2Ffvang/lists"}