-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incomplete Fig configuration, requires better support for working wit…
…h Postgres outside of a Docker container
- Loading branch information
Showing
7 changed files
with
103 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,41 @@ | ||
default: &default | ||
adapter: postgresql | ||
encoding: unicode | ||
host: <%= ENV['DEV_POSTGRES_HOST'] || 'localhost' %> | ||
password: | ||
pool: 5 | ||
port: <%= ENV['DEV_POSTGRES_PORT'] || 5432 %> | ||
username: <%= ENV['DEV_POSTGRES_USER'] || 'vagrant' %> | ||
<% | ||
if ENV['DOCKER_DATABASE_URL'] | ||
database_name = URI(ENV['DOCKER_DATABASE_URL']).path[1..-1] | ||
%> | ||
# url: <%= ENV['DOCKER_DATABASE_URL'] %> Needs Rails 4 | ||
# postgresql://user:password@host:port/database | ||
|
||
|
||
username: <%= URI(ENV['DOCKER_DATABASE_URL']).user %> | ||
<% if URI(ENV['DOCKER_DATABASE_URL']).password.present? %> | ||
password: <%= URI(ENV['DOCKER_DATABASE_URL']).password %> | ||
<% end %> | ||
#host: <%= URI(ENV['DOCKER_DATABASE_URL']).host %> | ||
host: coderwall.local | ||
port: <%= URI(ENV['DOCKER_DATABASE_URL']).port %> | ||
<% | ||
else | ||
database_name = 'coderwall' | ||
%> | ||
|
||
username: vagrant | ||
password: | ||
host: localhost | ||
port: 5432 | ||
<% end %> | ||
|
||
development: | ||
database: <%= "#{database_name}_development" %> | ||
<<: *default | ||
database: coderwall_development | ||
|
||
test: | ||
database: <%= "#{database_name}_test" %> | ||
<<: *default | ||
database: coderwall_test | ||
|
||
production: | ||
database: <%= "#{database_name}_production" %> | ||
<<: *default | ||
database: coderwall_production |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
web: | ||
build: . | ||
command: foreman start -p 5000 web | ||
volumes: | ||
- .:/app | ||
ports: | ||
- "5000:5000" | ||
links: | ||
- postgres | ||
- redis | ||
- elasticsearch | ||
- mongo | ||
environment: | ||
- DEV_POSTGRES_USER=postgres | ||
- DEV_POSTGRES_HOST=postgres | ||
- STRIPE_SECRET_KEY=sk_test_BQokikJOvBiI2HlWgH4olfQ2 | ||
- STRIPE_PUBLISHABLE_KEY= | ||
- REDIS_URL=redis://redis | ||
- ELASTICSEARCH_URL=http://elasticsearch:9200 | ||
- MONGO_URL=mongo:27017 | ||
|
||
postgres: | ||
image: postgres | ||
ports: | ||
- "5432" | ||
- "5432:5432" | ||
|
||
redis: | ||
image: redis | ||
image: redis:2.8.13 | ||
ports: | ||
- "6379:6379" | ||
|
||
elasticsearch: | ||
image: orchardup/elasticsearch | ||
image: barnybug/elasticsearch:0.90.13 | ||
ports: | ||
- "9200:9200" | ||
|
||
mongo: | ||
image: mongo | ||
image: mongo:2.4.10 | ||
ports: | ||
- "27017:27017" | ||
|
||
#web: | ||
#build: . | ||
#command: echo hello # foreman start -p 5000 web | ||
#volumes: | ||
#- .:/app | ||
#ports: | ||
#- "5000:5000" | ||
#links: | ||
#- postgres | ||
#- redis | ||
#- elasticsearch | ||
#- mongo | ||
#environment: | ||
#- DEV_POSTGRES_USER=postgres | ||
#- DEV_POSTGRES_HOST=postgres | ||
#- STRIPE_SECRET_KEY=sk_test_BQokikJOvBiI2HlWgH4olfQ2 | ||
#- STRIPE_PUBLISHABLE_KEY= | ||
#- REDIS_URL=redis://redis:6379 | ||
#- ELASTICSEARCH_URL=http://elasticsearch:9200 | ||
#- MONGO_URL=mongo:27017 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
vagrant up | ||
vagrant ssh -c ". /home/vagrant/web/vagrant/run" | ||
|
||
#export DOCKER_HOST=tcp://192.168.59.103:2376 | ||
#echo $DOCKER_HOST | ||
|
||
#export DOCKER_CERT_PATH=/Users/mike/.boot2docker/certs/boot2docker-vm | ||
#echo $DOCKER_CERT_PATH | ||
|
||
#export DOCKER_TLS_VERIFY=1 | ||
#echo $DOCKER_TLS_VERIFY | ||
|
||
#export REDIS_URL=redis://$(echo $DOCKER_HOST | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'):6379 | ||
#echo $REDIS_URL | ||
|
||
#export POSTGRES_URL=postgres://postgres@$(echo $DOCKER_HOST | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'):5432/postgres | ||
#echo $POSTGRES_URL | ||
|
||
#export MONGO_URL=mongodb://$(echo $DOCKER_HOST | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'):27017/badgify | ||
#echo $MONGO_URL | ||
|
||
#export DOCKER_DATABASE_URL=$POSTGRES_URL | ||
#echo $DOCKER_DATABASE_URL | ||
|
||
#fig build postgres redis mongo | ||
#fig up -d postgres redis mongo | ||
|
||
#rvm use ruby@coderwall --install --create | ||
#bundle check || bundle install | ||
|
||
#export RAILS_ENV=development | ||
#export RACK_ENV=development | ||
|
||
#bundle exec rake db:drop | ||
#bundle exec rake db:create | ||
#bundle exec rake db:migrate | ||
#bundle exec rake db:test:prepare | ||
|
||
#bundle exec rails server webrick -p 3000 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
sudo su - vagrant <<-'EOF' | ||
cd ~/web | ||
rvm requirements | ||
bundle check && bundle install | ||
bundle check || bundle install | ||
cd | ||
rm -rf ~/bootstrap | ||
EOF |