OOrchard

Docker Compose

Orchard uses PostgreSQL for storage. The repository includes a Docker Compose file for running just the database.

docker-compose.yml

The file at the root of the orchard repository:

code
services:
  postgres:
    image: postgres:16-alpine
    container_name: orchard-postgres
    environment:
      POSTGRES_USER: orchard
      POSTGRES_PASSWORD: orchard
      POSTGRES_DB: orchard
    ports:
      - "5432:5432"
    volumes:
      - orchard-postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U orchard"]
 
volumes:
  orchard-postgres-data:

Running

code
docker compose up -d postgres

Running the Server

The Orchard API server (Trellis) currently runs as a native process, not a container. After PostgreSQL is running:

code
./gradlew :trellis:bootRun

Or with the native binary:

code
./gradlew install
~/.orchard/bin/orchard-server

The install task builds native images for both Trellis and Trowel and copies them into ~/.orchard/bin/. (Running ./gradlew :trellis:nativeCompile alone only produces the binary under trellis/build/native/nativeCompile/ — it does not install it.)

The dev-server profile (activated by trowel dev-server start) uses an embedded H2 database and does not require PostgreSQL. This is useful for local testing.

For a production deployment, also run Fence alongside Trellis — not containerized here, started from its release JAR (java -jar fence.jar). See the Deployment guide's Authentication (Fence) section for the required setup. Don't run Postgres-backed Trellis in production without it. Likewise run the SSH gateway from its release JAR (java -jar gateway.jar) on the same host. It's how cultivators SSH into groves in production. See the Deployment guide's SSH Gateway section.