flask-sinatra-martini-practice

flask-sinatra-martini 블로그 글 따라하기

참고

Running Ruby Locally

Install the required Rubygems:

$ bundle install

Set an environment variable to point to the location of your MongoDB instance

$ export DB_PORT_27017_TCP_ADDR=127.0.0.1:27017

Start mongodb:

$ mongod

Run sinatra:

$ ruby app.rb

Go Prerequisite

Go Path 설정 방법

$ export GOPATH=$HOME/workspace/webapp

Package import 방법

참고: https://github.com/go-martini/martini

$ mkdir -p $GOPATH/github.com/go-martini/martini
$ mkdir -p $GOPATH/github.com/martini-contrib/render
$ go get github.com/go-martini/martini
$ go get github.com/martini-contrib/render

Docker Environment variables

참고: http://blog.bananacoding.com/blog/development-workflow-using-docker-and-docker-compose

Can list environment variables in web container using:

$ docker-compose run web env

output:

Starting python_db_1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=4ff8e1bd38f8
TERM=xterm
DB_PORT=tcp://172.17.0.2:27017
DB_PORT_27017_TCP=tcp://172.17.0.2:27017
DB_PORT_27017_TCP_ADDR=172.17.0.2
DB_PORT_27017_TCP_PORT=27017
DB_PORT_27017_TCP_PROTO=tcp
DB_NAME=/python_web_run_1/db
DB_ENV_GOSU_VERSION=1.7
DB_ENV_GPG_KEYS=DFFA3DCF326E302C4787673A01C4E7FAAAB2461C
DB_ENV_MONGO_MAJOR=3.2
DB_ENV_MONGO_VERSION=3.2.6
...