[0] https://github.com/dokku/dokkuCapRover: Build your own PaaS
11–20 of 183 posts
Re: CapRover: Build your own PaaS
#12Another great alternative in this space is dokku[0]. Haven't tried CapRover recently but it looks fantastic. [0]: https://github.com/dokku/dokku
Re: CapRover: Build your own PaaS
#13For those who have even simpler needs (like side projects, or 1 dev projects), I found using simply docker and git to be plenty enough. Basically, you can create a bare git repository on your server (`git init --bare`), and put a `hooks/post-receive` script within it that will clone sources in a temporary directory, build the docker image and rotate containers. That way, you can `git push` to build and deploy, and it…
#!/usr/bin/env bash
export APP=appname
export DOCKER_OPTS=""
unset GIT_DIR
rm -rf /home/username/apps/$APP
cd /home/username/apps && \
git clone /home/username/git/$APP && \
cd $APP && \
echo building image && \
docker build -t $APP .
if [[ "$?" != "0" ]]; then
echo "error while building image."
exit 1
fi
echo "Stopping previous container..."
docker stop $APP
echo "Starting new container..."
sleep 1
docker run -d --name $APP --rm $APPRe: CapRover: Build your own PaaS
#14Slightly nitpicky, but is something a PaaS if you run it yourself? Anything as a Service isn't a service if you're running it yourself. It's just ... infrastructure.
Re: CapRover: Build your own PaaS
#15Slightly nitpicky, but is something a PaaS if you run it yourself? Anything as a Service isn't a service if you're running it yourself. It's just ... infrastructure.
Re: CapRover: Build your own PaaS
#16For those who have even simpler needs (like side projects, or 1 dev projects), I found using simply docker and git to be plenty enough. Basically, you can create a bare git repository on your server (`git init --bare`), and put a `hooks/post-receive` script within it that will clone sources in a temporary directory, build the docker image and rotate containers. That way, you can `git push` to build and deploy, and it…
Here is an example of post-receive script I use for that: #!/usr/bin/env bash export APP=appname export DOCKER_OPTS="" unset GIT_DIR rm -rf /home/username/apps/$APP cd /home/username/apps && \ git clone /home/username/git/$APP && \ cd $APP && \ echo building image && \ docker build -t $APP . if [[ "$?" != "0" ]]; then echo "error while building image." exit 1 fi echo "Stopping previous container..." docker stop $APP…
GIT_WORK_TREE=/home/username/apps/$APP git checkout masterRe: CapRover: Build your own PaaS
#17Combined with portainer (which u can install with caprover) I'm improving my docker knowledge. I'd recommend it for someone starting out with containers and "home labs".
Re: CapRover: Build your own PaaS
#18Re: CapRover: Build your own PaaS
#19For those who have even simpler needs (like side projects, or 1 dev projects), I found using simply docker and git to be plenty enough. Basically, you can create a bare git repository on your server (`git init --bare`), and put a `hooks/post-receive` script within it that will clone sources in a temporary directory, build the docker image and rotate containers. That way, you can `git push` to build and deploy, and it…
Re: CapRover: Build your own PaaS
#20Earlier quoted context omitted.
Here is an example of post-receive script I use for that: #!/usr/bin/env bash export APP=appname export DOCKER_OPTS="" unset GIT_DIR rm -rf /home/username/apps/$APP cd /home/username/apps && \ git clone /home/username/git/$APP && \ cd $APP && \ echo building image && \ docker build -t $APP . if [[ "$?" != "0" ]]; then echo "error while building image." exit 1 fi echo "Stopping previous container..." docker stop $APP…
FYI, you can avoid the $APP directory removal and clone by doing: GIT_WORK_TREE=/home/username/apps/$APP git checkout master