Live data from Hacker News

CapRover: Build your own PaaS

caprover.com

11–20 of 183 posts

Re: CapRover: Build your own PaaS

#11
Caprover is a great tool to have in one's kit but coming from Dokku [0] i think it lacks a certain flexibility when deploying applications with worker processes. You can get around this by creating multiple "captain-definition" files in your project but i prefer Dokku's adherence to Heroku's "Procfile" approach. However Caprover's web admin/dashboard and docker swarm features are a nice touch.

  [0] https://github.com/dokku/dokku

Re: CapRover: Build your own PaaS

#12

Another great alternative in this space is dokku[0]. Haven't tried CapRover recently but it looks fantastic. [0]: https://github.com/dokku/dokku

I've recently learned about exoframe as well, but haven't tried it yet. https://github.com/exoframejs/exoframe

Re: CapRover: Build your own PaaS

#13
post #5

For 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

    echo "Starting new container..."
    sleep 1
    docker run -d --name $APP --rm $APP

Re: CapRover: Build your own PaaS

#15
post #7

Slightly 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.

maybe you want to decouple sysadmins from devops? sufficiently large orgs with sufficiently large on-prem infra have these kinds of problems.

Re: CapRover: Build your own PaaS

#16
post #5

For 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…

FYI, you can avoid the $APP directory removal and clone by doing:

    GIT_WORK_TREE=/home/username/apps/$APP git checkout master

Re: CapRover: Build your own PaaS

#17
I'm using CapRover on a personal server of mine and it's pretty awesome. I use it for side projects and tinkering and tooling (analytics, bitwarden). it's very stable with lots of "one click app deploys" of popular open source software.

Combined 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

#18
This tool looks really cool. The section where it listed reasons for using it really struck a chord with me. I am not the most comfortable using all the Linux tools when it comes to setting up servers / system administration. This product looks to be a really good bridge between devs who dev primarily, and those with skills in deployment. Super cool. Thanks for sharing, I will be using this!

Re: CapRover: Build your own PaaS

#19
post #5

For 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…

I actually developed a system similar to this but used docker compose as an alternative to Procfiles and nginx+le to handle dynamic virtual hosting. It's actually a golang app that will automatically provision git repos with the necessary hooks and also allow you to exec into a container directly over SSH. I had the thought of using docker stack to achieve zero downtime but haven't had a chance to try that out. Happy to open source it if anyone is interested in using it.

Re: CapRover: Build your own PaaS

#20

Earlier 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

Yes, that's true, thanks for mentioning it. It comes from a time when I did not use docker so I wanted to get rid of build artifacts, but building within docker, this is not a problem anymore.
Post reply on HN