setup.sh - docker-images - Various docker image builds I have created over the years.
(HTM) git clone git://jay.scot/docker-images
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
setup.sh (1095B)
---
1 #!/bin/bash
2 #
3 # based of a setup script by pandrew/metasploit
4 #
5
6 VOXUSER="warvox"
7 VOXPASS="changeme"
8
9 USEREXIST="$(psql -h $DB_PORT_5432_TCP_ADDR -p 5432 -U postgres postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='$VOXUSER'")"
10 if [[ ! $USEREXIST -eq 1 ]]
11 then
12 psql -h $DB_PORT_5432_TCP_ADDR -p 5432 -U postgres postgres -c "create role $VOXUSER WITH SUPERUSER login password '$VOXPASS'"
13 fi
14
15 DBEXIST="$(psql -h $DB_PORT_5432_TCP_ADDR -p 5432 -U postgres postgres -l | grep warvox)"
16 if [[ ! $DBEXIST ]]
17 then
18 psql -h $DB_PORT_5432_TCP_ADDR -p 5432 -U postgres postgres -c "CREATE DATABASE warvox OWNER $VOXUSER;"
19 fi
20
21 sh -c "echo 'production:
22 adapter: postgresql
23 database: warvox
24 username: $VOXUSER
25 password: $VOXPASS
26 host: $DB_PORT_5432_TCP_ADDR
27 port: 5432
28 pool: 75
29 timeout: 5' > /home/warvox/config/database.yml"
30
31 cd /home/warvox
32 make database
33 cp /home/warvox/config/secrets.yml.example /home/warvox/config/secrets.yml
34 bin/adduser admin godsexlove
35 export RAILS_SERVE_STATIC_FILES=true
36 RAILS_ENV=production bundle exec rake assets:precompile
37 bin/warvox --address 0.0.0.0