mirror of
https://github.com/dokku/dokku.git
synced 2026-05-18 05:05:46 +02:00
Merge pull request #1 from rnorth/master
Prerequisite changes to allow Java buildpack support
This commit is contained in:
14
README.md
14
README.md
@@ -27,7 +27,7 @@ That's it!
|
||||
|
||||
## Deploy an App
|
||||
|
||||
Right now Buildstep supports the Node.js and Ruby buildpacks. It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)! Let's deploy
|
||||
Right now Buildstep supports the Node.js, Ruby and Java buildpacks. It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)! Let's deploy
|
||||
the Heroku Node.js sample app. All you have to do is add a remote to name the app. It's created on-the-fly.
|
||||
|
||||
$ cd node-js-sample
|
||||
@@ -50,6 +50,18 @@ the Heroku Node.js sample app. All you have to do is add a remote to name the ap
|
||||
|
||||
You're done!
|
||||
|
||||
## Advanced installation (for development)
|
||||
|
||||
The bootstrap script allows source git repository URLs to be overridden to include customizations from your own
|
||||
repositories. The GITRECEIVE_URL, BUILDSTEP_REPO and DOKKU_REPO environment variables
|
||||
may be set to override the defaults (see the bootstrap.sh script for how these apply):
|
||||
|
||||
Example:
|
||||
|
||||
$ wget j.mp/dokku-bootstrap
|
||||
$ chmod +x bootstrap.sh
|
||||
$ DOKKU_REPO=https://github.com/yourusername/dokku.git bootstrap.sh
|
||||
|
||||
## Components
|
||||
|
||||
* [Docker](https://github.com/dotcloud/docker) - Container runtime and manager
|
||||
|
||||
12
bootstrap.sh
12
bootstrap.sh
@@ -1,3 +1,9 @@
|
||||
# Repository locations - set environment variables to override defaults
|
||||
# e.g. OVERRIDE_DOKKU_REPO=https://github.com/yourusername/dokku.git bootstrap.sh
|
||||
GITRECEIVE_URL=${GITRECEIVE_URL:-"https://raw.github.com/progrium/gitreceive/master/gitreceive"}
|
||||
BUILDSTEP_REPO=${BUILDSTEP_REPO:-"https://github.com/progrium/buildstep.git"}
|
||||
DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"}
|
||||
|
||||
# Docker and base dependencies
|
||||
apt-get install -y linux-image-extra-`uname -r`
|
||||
apt-get install -y software-properties-common
|
||||
@@ -8,20 +14,20 @@ apt-get install -y git ruby nginx make
|
||||
|
||||
# gitreceive
|
||||
cd /usr/local/bin
|
||||
wget https://raw.github.com/progrium/gitreceive/master/gitreceive
|
||||
wget ${GITRECEIVE_URL}
|
||||
chmod +x gitreceive
|
||||
gitreceive init
|
||||
|
||||
# buildstep
|
||||
cd ~
|
||||
git clone https://github.com/progrium/buildstep.git
|
||||
git clone ${BUILDSTEP_REPO}
|
||||
cd buildstep
|
||||
cp buildstep /home/git/buildstep
|
||||
make
|
||||
|
||||
# dokku (this!)
|
||||
cd ~
|
||||
git clone https://github.com/progrium/dokku.git
|
||||
git clone ${DOKKU_REPO}
|
||||
cd dokku
|
||||
cp receiver /home/git/receiver
|
||||
cp nginx-app-conf /home/git/nginx-app-conf
|
||||
|
||||
6
receiver
6
receiver
@@ -12,10 +12,10 @@ 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")
|
||||
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")
|
||||
echo $ID > "$HOME/$1/CONTAINER"
|
||||
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 +31,4 @@ if [[ $DOMAIN ]]; then
|
||||
else
|
||||
echo " http://$(hostname -i | cut -d' ' -f3):$PORT"
|
||||
fi
|
||||
echo
|
||||
echo
|
||||
Reference in New Issue
Block a user