Deployment

Deployment

While Brespi can run standalone, Docker is the recommended approach.

Please keep in mind that there are no pre-built Docker images. Instead, Brespi provides a build script that generates an image tailored to your setup.

Everything starts by cloning the Brespi repository.

# Clone the repository
git clone https://github.com/butterhosting/brespi.git
cd brespi

# Specify a version or commit hash (optional)
git checkout 1.0.0

Docker image

To create a Docker image, execute the following command in the project's root folder.

./brespi image create

This command can be used with the --postgresql and --mariadb flags to ensure that the respective database client tools will be included in the created Docker image (which are required if your pipelines use PostgreSQL, MariaDB or MySQL backup steps).

./brespi image create --postgresql --mariadb

For fully custom runtime environments, you can also provide your own Dockerfile using the --dockerfile option. See the deployment/ directory in the source code for some examples.

Docker examples

After successfully building a Brespi image via ./brespi image create, you can verify it starts correctly via this command:

docker run --rm -p 3000:3000 brespi:latest

If you're looking to try Brespi out with a real PostgreSQL database, you can run docker compose up inside a folder containing the following compose.yaml file.

services:
  brespi:
    image: brespi:latest
    ports:
      - "3000:3000"
    environment:
      POSTGRESQL_URL: "postgresql://admin:password@postgres:5432"
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:17
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: password
    configs:
      - source: seed
        target: /docker-entrypoint-initdb.d/seed.sql
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "admin"]
      interval: 1s
      timeout: 10s
      retries: 10

configs:
  seed:
    content: |
      CREATE DATABASE musicworld;
      \c musicworld;
      CREATE TABLE instruments (
          id SERIAL PRIMARY KEY,
          name VARCHAR(100),
          category VARCHAR(50),
          price DECIMAL(10, 2)
      );
      INSERT INTO instruments (name, category, price) VALUES
          ('Fender Stratocaster', 'Electric Guitar', 1299.99),
          ('Gibson Les Paul', 'Electric Guitar', 2499.99),
          ('Yamaha P-125', 'Digital Piano', 649.99),
          ('Roland TD-17KV', 'Electronic Drums', 1699.99),
          ('Shure SM58', 'Microphone', 99.99);

In a more realistic composed setup, you'll likely have Brespi joining external Docker networks and volumes:

services:
  brespi:
    image: brespi:latest
    ports:
      - "3000:3000"
    volumes:
      - ./config.json:/opt/brespi/config.json
      - ./.htpasswd:/opt/brespi/.htpasswd:ro
      - brespi-data:/opt/brespi/data/
      - wordpress-uploads:/mnt/wp-uploads:ro
    environment:
      ENCRYPTION_KEY: "secret-encryption-key"
      S3_URL: "s3://ACCESS_KEY:SECRET_KEY@s3.eu-central-1.amazonaws.com/backups"
      POSTGRESQL_URL: "postgresql://brespi:secretpassword@postgresql:5432"
      MARIADB_URL: "mariadb://brespi:secretpassword@mariadb:3306"
      SLACK_URL: "https://hooks.slack.com/services/T00/B00/xxxx"
    networks:
      - postgresql
      - wordpress

volumes:
  brespi-data:
  wordpress-uploads:
    external: true

networks:
  postgresql:
    external: true
  wordpress:
    external: true

Environment vars

When starting Brespi, the following environment variables can be specified.

VariableOptionsDescription
BRESPI_LOGGINGdebug, info, warn, error (default warn)Specifies Brespi's logging level
BRESPI_TIMEZONEIANA time zone (default UTC)Specifies the timezone used for interface localization, log timestamps and cron-based scheduling
BRESPI_SUPPORT_TOKENoptionalSpecifies a Brespi support token; click here for more information

Standalone

To run Brespi without Docker, please make sure the following are installed on your system:

  • Bun
  • Any database client tools your pipelines require (psql, mysqldump, etc.)

After cloning the respository, Brespi can then be started as follows.

# Install dependencies
bun install --production

# Start the application on port 3000
bun start:prod