mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Sourcing the profile files which Heroku buildpacks set up for us (in /app/.profile.d), so that dependencies downloaded by the buildpack are available on PATH.
The docker run command which starts the app is now a little verbose so maybe should be refactored into a separate script; part of the verbosity is because of guarding against absence of the .profile.d directory. This is to support use of the Java buildpack but has also been tested working for a simple Ruby web app.
This commit is contained in:
7
receiver
7
receiver
@@ -12,10 +12,11 @@ if [[ -f "$HOME/$1/PORT" ]]; then
|
||||
OLDID=$(< "$HOME/$1/CONTAINER")
|
||||
docker kill $OLDID > /dev/null
|
||||
PORT=$(< "$HOME/$1/PORT")
|
||||
ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $APP /bin/bash -c "cd /app && ./start")
|
||||
echo $ID > "$HOME/$1/CONTAINER"
|
||||
ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $APP /bin/bash -c "if [ -d /app/.profile.d ]; then source /app/.profile.d/*; fi; cd /app && ./start")
|
||||
else
|
||||
ID=$(docker run -d -p 5000 -e PORT=5000 $APP /bin/bash -c "cd /app && ./start")
|
||||
|
||||
ID=$(docker run -d -p 5000 -e PORT=5000 $APP /bin/bash -c "if [ -d /app/.profile.d ]; then source /app/.profile.d/*; fi; cd /app && ./start")
|
||||
echo $ID > "$HOME/$1/CONTAINER"
|
||||
PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)["NetworkSettings"]["PortMapping"]["5000"]')
|
||||
echo $PORT > "$HOME/$1/PORT"
|
||||
@@ -31,4 +32,4 @@ if [[ $DOMAIN ]]; then
|
||||
else
|
||||
echo " http://$(hostname -i | cut -d' ' -f3):$PORT"
|
||||
fi
|
||||
echo
|
||||
echo
|
||||
Reference in New Issue
Block a user