-
-
Save double-z/56df4cea94919e407bc00992bdad072d to your computer and use it in GitHub Desktop.
Habitat Rails Sample Comands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hab studio enter | |
hab pkg export docker core/postgresql | |
hab pkg export docker core/ruby-rails-sample | |
# Terminal - 1 | |
docker run -e HAB_POSTGRESQL='initdb_superuser_password = "rails_sample"' -p 9631:9631 -p 5432:5432 -v rails_pg_data:/hab/svc/postgresql/data -it core/postgresql | |
# Terminal - 2 | |
psql hab -d postgres -h $(docker-machine ip default) # rails_sample | |
docker run -p 3000:3000 -it core/ruby-rails-sample --bind database:postgresql.default --peer 172.17.0.2 | |
# hab studio enter | |
hab config apply --peer 172.17.0.2 ruby-rails-sample.default 1 < rails.toml | |
# Terminal - 2 | |
docker run -p 3000:3000 -it core/ruby-rails-sample --bind database:postgresql.default --peer 172.17.0.2 | |
psql hab -d postgres -h $(docker-machine ip default) | |
# psql | |
CREATE ROLE "ruby-rails-sample" LOGIN; | |
CREATE DATABASE "ruby-rails-sample_production" ENCODING 'UTF8' OWNER "ruby-rails-sample"; | |
\password "ruby-rails-sample" # rails_sample | |
# Terminal - 2 | |
docker run -p 3000:3000 -it core/ruby-rails-sample --bind database:postgresql.default --peer 172.17.0.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment