Skip to content

Quickstart

Kim Oliver Drechsel edited this page Sep 19, 2024 · 8 revisions

There are two ways to run this application:

Choose the method that best suits your needs.

You also need to create an access token that the application will use to authenticate with your Git provider. See Setup Access Token to create the access token.

After that, check out the Next steps section to continue with the setup.

With non-root user (recommended)

Deploy the application with the default non-root user by specifying the group_add option in the docker-compose.yml file.

Tip

The group_add option is used to add groups to the user inside the container.

The non-root user usually does not have the required group to access the Docker socket and the group id may vary, so you will need to add the group to the user yourself.

You can find the required group id in the logs by running the application without this option or when a wrong group id is specified. If the error is not shown in the logs, you already have the correct group id specified.

Alternatively, you can run stat -c %g /var/run/docker.sock or ls -ln /var/run/docker.sock on the docker host to get the group id.

docker-compose.yml

services:
  app:
    container_name: doco-cd
    image: ghcr.io/kimdre/doco-cd:latest
    restart: unless-stopped
    ports:
      - "80:80"
    environment:
      GIT_ACCESS_TOKEN: xxx
      WEBHOOK_SECRET: xxx
    group_add:
      - "971"  # change to the docker group id shown in the app error logs or in the output of `ls -ln /var/run/docker.sock`
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

With root user

Deploy the application with the root user by specifying the user option in the docker-compose.yml file.

Tip

The user option is used to specify the user inside the container and can be either a username (e.g. root) or a user id (e.g. 1000).

docker-compose.yml

services:
  app:
    container_name: doco-cd
    image: ghcr.io/kimdre/doco-cd:latest
    restart: unless-stopped
    ports:
      - "80:80"
    environment:
      GIT_ACCESS_TOKEN: xxx
      WEBHOOK_SECRET: xxx
    user: root
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

Running the application

After you have set up the docker-compose.yml file, you can run the application with the following command:

docker compose up -d

To be able to reach the application via SaaS products like Github or Gitlab, you need to expose the http endpoint of the application to the internet. You can use a reverse proxy like NGINX, Traefik or Caddy for this purpose.

Next steps

After you have set up the application, you can proceed with the following steps:

  1. App Settings - Configure the application settings.
  2. Deploy Settings - Configure the Docker Compose deployment in your repositories.
  3. Webhook Setup - Set up a webhook for your deployments.