mirror of
https://github.com/czhu12/canine.git
synced 2025-12-17 00:44:33 -06:00
added dockerfile for local run
This commit is contained in:
@@ -6,9 +6,9 @@ if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
|
||||
export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)"
|
||||
fi
|
||||
|
||||
# If running the rails server or bin/dev then create or migrate existing database
|
||||
# If running the rails server, bin/dev, or bin/run then create or migrate existing database
|
||||
echo "Checking if database needs to be prepared..."
|
||||
if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ] || [ "${1}" == "./bin/dev" ]; then
|
||||
if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ] || [ "${1}" == "./bin/dev" ] || [ "${1}" == "./bin/run" ]; then
|
||||
echo "Preparing database..."
|
||||
./bin/rails db:create
|
||||
./bin/rails db:prepare
|
||||
|
||||
13
bin/run
Executable file
13
bin/run
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
if ! gem list foreman -i --silent; then
|
||||
echo "Installing foreman..."
|
||||
gem install foreman
|
||||
fi
|
||||
|
||||
# Let the debug gem allow remote connections,
|
||||
# but avoid loading until `debugger` is called
|
||||
export RUBY_DEBUG_OPEN="true"
|
||||
export RUBY_DEBUG_LAZY="true"
|
||||
|
||||
exec foreman start -f Procfile "$@"
|
||||
Reference in New Issue
Block a user