GithubHelp home page GithubHelp logo

devvagrant's Introduction

Automatically deploy a simple Flask "Hello World" app in a VM using Vagrant. Serves content via Apache and mod_wsgi.

Minimal example getting started with Vagrant, Flask, Apache, and mod_wsgi. To keep things simple, the Vagrant bootstrap is a single bash script (no Salt or Ansible here), the Flask app is a simple "Hello World", and it is only tested with the bento/Ubuntu-18.04 base box.

Getting started

To start, make sure you have VirtualBox and Vagrant installed on your Windows, Mac, or Linux host:

First Step (Clone The Repo)

git clone https://github.com/devozg/devVagrant.git

Once you have the source code (and you have unzipped it if you're using a release), change directory into vagrant-apache-flask-minimal, and make sure the associated Vagrant box (bentu/ubuntu-18.04) is added:

cd devozg/devVagrant
vagrant up 
# or 
vagrant box add bento/ubuntu-18.04 && vagrant up

If You be prompted for a provider. Select 2) virtualbox by typing '2' and hitting enter. (the default provider is virtualbox)

The first time you run vagrant box add bento/ubuntu-18.04 may take some time. (Note: You only need to run "vagrant box add" for a specific box the first time after installing Vagrant. You may be promted to run the command vagrant box update in the future when attempting to run vagrant up in order to keep the box up to date).

from within the vagrant-apache-flask-minimal directory. This step can take a some time the first time you run the software. The installation script will provide feedback in the console as it installs each package. Once the virtual machine has been provisioned, open a web browser on your host and navigate to:

127.0.0.1:8080

to see the minimal app running.

Terminating the service and virtual machine

If you need to stop the service, you can type:

vagrant halt

In the devozg/devVagrant directory in the console or terminal on your host machine. The next time you issue the "vagrant up" command, the VM will restart in its previous state.

If you need to delete the VM entirely, you can the the following command after halting the VM:

vagrant destroy

If you have made changes on local file (exmp. minimal/minimal.py) to refresh the vm run:

vagrant reload --provision # (Force the provisioners to run)

devvagrant's People

Contributors

devozg avatar

Watchers

 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.