refactor(docker-setup): use bash instead of ruby (#6935)
* refactor(docker-setup): use bash instead of ruby * refactor: use a proper header * refactor: bash -> sh
This commit is contained in:
parent
56c11d3e0d
commit
604e76dd88
3 changed files with 11 additions and 22 deletions
10
bin/docker-setup
Executable file
10
bin/docker-setup
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
echo "== Building Docker image (this may take a while) =="
|
||||
docker-compose build
|
||||
|
||||
echo "== Setting up database =="
|
||||
docker-compose run web rails db:setup db:migrate search:setup
|
||||
|
||||
echo "== Starting app =="
|
||||
docker-compose up
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require "fileutils"
|
||||
|
||||
# path to your application root.
|
||||
APP_ROOT = File.expand_path("..", __dir__)
|
||||
|
||||
def system!(*args)
|
||||
system(*args) || abort("\n== Command #{args} failed ==")
|
||||
end
|
||||
|
||||
FileUtils.chdir APP_ROOT do
|
||||
puts "== Building Docker image (this may take a while) =="
|
||||
system!("docker-compose build")
|
||||
|
||||
puts "== Setting up database =="
|
||||
system!("docker-compose run web rails db:setup db:migrate search:setup")
|
||||
|
||||
puts "== Starting app =="
|
||||
system!("docker-compose up")
|
||||
end
|
||||
|
|
@ -59,7 +59,7 @@ _Docker compose will by default use postgres:9.6 as the database version, should
|
|||
you want to update that set the `POSTGRES_VERSION` variable in your environment
|
||||
and start the container again_
|
||||
|
||||
1. Run `bin/docker_setup`
|
||||
1. Run `bin/docker-setup`
|
||||
2. That's it! Navigate to <http://localhost:3000>
|
||||
|
||||
The script executes the following steps:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue