add docker setup

This commit is contained in:
João Victor Geonizeli
2022-02-28 17:33:13 -03:00
parent daf7ea0c73
commit fb156eef7e
6 changed files with 118 additions and 0 deletions

25
scripts/setup Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e
cd $(dirname $(dirname $0))
yellow_text(){
echo "`tput setaf 3`$@`tput sgr0`"
}
green_text(){
echo "`tput setaf 2`$@`tput sgr0`"
}
if [ -f Dockerfile ]; then
docker build --build-arg UID=$UID -t strider-posterr .
else
red_text 'Could not find Dockerfile. Please run this script from the root of the project.'
return
fi
yellow_text 'Preparing the database...'
docker-compose run --rm web rails db:create db:migrate
green_text 'Everything ready to run!'