Skip to main content

Prerequisites

  • Docker
  • Docker Compose

Docker Compose

Create a docker-compose.yml file with the following contents. Make sure to update the docker group id.
services:
  blink-server:
    image: ghcr.io/coder/blink-server:latest
    restart: unless-stopped
    # the server must be able to access agents that are port-bound to the host
    network_mode: host
    group_add:
      # the group that owns the docker.sock file
      # run `stat -c '%g' /var/run/docker.sock` to get the group id
      - "1001" # Change me!
    volumes:
      # the server must be able to access the docker.sock file
      # to spawn agent containers
      - /var/run/docker.sock:/var/run/docker.sock
      - blink-config:/home/server/.config/blink-server/
    environment:
      - BLINK_POSTGRES_URL=${BLINK_POSTGRES_URL:-postgresql://postgres:postgres@localhost:5432/blink}
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:17-alpine
    restart: unless-stopped
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=${POSTGRES_USER:-postgres}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
      - POSTGRES_DB=${POSTGRES_DB:-blink}
    volumes:
      - blink-pgdata:/var/lib/postgresql/data
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-blink}",
        ]
      interval: 1s
      timeout: 30s
      retries: 30

volumes:
  blink-pgdata:
  blink-config:

Starting the Server

docker compose up