basic setup

This commit is contained in:
Michael Zhang 2015-12-21 01:04:00 -06:00
parent b01d3f7cf0
commit e6b2e45848
6 changed files with 46 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.vagrant

21
Vagrantfile vendored Normal file
View file

@ -0,0 +1,21 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
# config.vm.box_check_update = false
config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true
config.vm.network :forwarded_port, guest: 8000, host: 8000, auto_correct: true
config.vm.network :forwarded_port, guest: 27017, host: 27017, auto_correct: true
config.vm.synced_folder "server", "/home/vagrant/server"
config.vm.synced_folder "scripts", "/home/vagrant/scripts"
config.vm.provision :shell, :path => "scripts/setup.sh"
config.ssh.forward_agent = true
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
end

2
deploy Normal file
View file

@ -0,0 +1,2 @@
#!/bin/bash

2
scripts/requirements.txt Normal file
View file

@ -0,0 +1,2 @@
Flask
gunicorn

11
scripts/setup.sh Normal file
View file

@ -0,0 +1,11 @@
#!/bin/bash
echo "Updating system..."
apt-get -y update
apt-get -y upgrade
echo "Installing dependencies..."
apt-get -y install python-pip
echo "Installing pip dependencies..."
pip install -r scripts/requirements.txt

9
server/app.py Normal file
View file

@ -0,0 +1,9 @@
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "Hello, EasyCTF!"
app.run(port=8000)