Recent submissions

Comment · 6 years ago
dokku is also meant to build a custom image on deploy : rather than using heroku's buildpacks, you can put a Dockerfile at the root of your project and it will be used instead.

So basically, you could put a Dockerfile file container just FROM and MAINTAINER, referring the image you want to use in the FROM, and dokku will download and execute it on `git push` (provided it can access to the image repository).

Comment · 6 years ago
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.
Comment · 6 years ago
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
Comment · 6 years ago
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's easy to migrate server.

The added bonus is that you now have a central git repos that can act as backup, so you don't need github or gitlab.

The main painpoint, which I find dokku interesting for (and I assume caprover too) is zero-downtime deployment. But well, if this is critical, you probably need something more extensive.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton