reym
Freym Setup

Docker Compose

Using this Docker Compose file, you can quickly set up a local development environment for Freym.

This setup includes all the necessary components to get started with Freym:

Credentials

Don't forget to login to our currently private docker registry using: docker login ghcr.io

docker-compose.yaml
services:
  sync:
    image: ghcr.io/fraym/sync:v0.5.0
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "/health"]
      interval: 5s
      timeout: 2s
      retries: 3
      start_period: 5s
    environment:
      - APP_ENV=development
      - LOG_LEVEL=info
    networks:
      - example

  streams:
    image: ghcr.io/fraym/streams:v6.2.0
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
        restart: true
      sync:
        condition: service_healthy
        restart: true
    healthcheck:
      test: ["CMD", "/health"]
      interval: 5s
      timeout: 2s
      retries: 3
      start_period: 5s
    ports:
      - 127.0.0.1:3001:3000
    environment:
      - APP_ENV=development
      - LOG_LEVEL=info
      - SYNC_CLIENT_ADDRESS=sync:9000
      - SYNC_CLIENT_APP_PREFIX=streams
      - POSTGRES_CONNECTION=postgres://postgres:example@postgres:5432
      - AUTH_SECRET=example256bitlongsecretforjwtgen
    networks:
      - example

  projections:
    image: ghcr.io/fraym/projections:v0.33.1
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
        restart: true
      sync:
        condition: service_healthy
        restart: true
      streams:
        condition: service_healthy
        restart: true
    healthcheck:
      test: ["CMD", "/health"]
      interval: 5s
      timeout: 2s
      retries: 3
      start_period: 5s
    ports:
      - 127.0.0.1:3002:3000
    environment:
      - APP_ENV=development
      - LOG_LEVEL=info
      - SYNC_CLIENT_ADDRESS=sync:9000
      - SYNC_CLIENT_APP_PREFIX=projections
      - POSTGRES_CONNECTION=postgres://postgres:example@postgres:5432
      - AUTH_SECRET=example256bitlongsecretforjwtgen
      - STREAMS_CLIENT_ADDRESS=streams:9000
      - STREAMS_CLIENT_GROUP_ID=projections
      - CORS_ALLOW_ORIGINS=*
    networks:
      - example

  crud:
    image: ghcr.io/fraym/crud:v0.29.1
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
        restart: true
      sync:
        condition: service_healthy
        restart: true
      streams:
        condition: service_healthy
        restart: true
      projections:
        condition: service_healthy
        restart: true
      s3:
        condition: service_healthy
        restart: true
      imgproxy:
        condition: service_healthy
        restart: true
    healthcheck:
      test: ["CMD", "/health"]
      interval: 5s
      timeout: 2s
      retries: 3
      start_period: 5s
    ports:
      - 127.0.0.1:3003:3000
    environment:
      - APP_ENV=development
      - LOG_LEVEL=info
      - SYNC_CLIENT_ADDRESS=sync:9000
      - SYNC_CLIENT_APP_PREFIX=crud
      - POSTGRES_CONNECTION=postgres://postgres:example@postgres:5432
      - AUTH_SECRET=example256bitlongsecretforjwtgen
      - STREAMS_CLIENT_ADDRESS=streams:9000
      - STREAMS_CLIENT_GROUP_ID=crud
      - PROJECTIONS_CLIENT_ADDRESS=projections:9000
      - CORS_ALLOW_ORIGINS=*
      - HTTP_REQUEST_BODY_LIMIT=10
      - IMGPROXY_URL=http://imgproxy:8080
      - S3_ENDPOINT=s3:9000
      - S3_ACCESS_KEY=root
      - S3_SECRET_KEY=example-s3-key
      - S3_SSL=false
      - S3_BUCKET=crud
    networks:
      - example

  auth:
    image: ghcr.io/fraym/auth:v0.15.0
    restart: unless-stopped
    depends_on:
      sync:
        condition: service_healthy
        restart: true
      streams:
        condition: service_healthy
        restart: true
      crud:
        condition: service_healthy
        restart: true
      deployments:
        condition: service_healthy
        restart: true
    healthcheck:
      test: ["CMD", "/health"]
      interval: 5s
      timeout: 2s
      retries: 3
      start_period: 5s
    ports:
      - 127.0.0.1:3004:3000
    environment:
      - APP_ENV=development
      - LOG_LEVEL=info
      - SYNC_CLIENT_ADDRESS=sync:9000
      - SYNC_CLIENT_APP_PREFIX=auth
      - AUTH_SECRET=example256bitlongsecretforjwtgen
      - AUTH_SECRET_INITIAL_PW=example256bitlongsecretforjwtgen
      - STREAMS_CLIENT_ADDRESS=streams:9000
      - STREAMS_CLIENT_GROUP_ID=auth
      - CRUD_CLIENT_ADDRESS=crud:9000
      - DEPLOYMENTS_API_TOKEN=example-management-token
      - DEPLOYMENTS_CLIENT_ADDRESS=deployments:9000
      - DEPLOYMENTS_NAMESPACE=FraymAuth
      - CORS_ALLOW_ORIGINS=*
    networks:
      - example

  deployments:
    image: ghcr.io/fraym/deployments:v0.21.0
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
        restart: true
    healthcheck:
      test: ["CMD", "/health"]
      interval: 5s
      timeout: 2s
      retries: 3
      start_period: 5s
    ports:
      - 127.0.0.1:3005:3000
    environment:
      - APP_ENV=development
      - LOG_LEVEL=info
      - API_TOKEN=example-management-token
      - AUTH_CLIENT_ADDRESS=auth:9000
      - CRUD_CLIENT_ADDRESS=crud:9000
      - PROJECTIONS_CLIENT_ADDRESS=projections:9000
      - POSTGRES_CONNECTION=postgres://postgres:example@postgres:5432
    networks:
      - example

  postgres:
    image: postgres:14-alpine
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
      interval: 30s
      timeout: 60s
      retries: 5
      start_period: 80s
    ports:
      - 127.0.0.1:5432:5432
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=example
    networks:
      - example

  s3:
    image: minio/minio:RELEASE.2025-04-22T22-12-26Z
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "mc", "ready", "local"]
      interval: 5s
      timeout: 5s
      retries: 5
    environment:
      - MINIO_ROOT_USER=root
      - MINIO_ROOT_PASSWORD=example-s3-key
    command: server /data --console-address ":9001"
    volumes:
      - s3_data:/data
    networks:
      - example

  imgproxy:
    image: darthsim/imgproxy:v3.26.0
    restart: unless-stopped
    depends_on:
      s3:
        condition: service_healthy
        restart: true
    healthcheck:
      test: ["CMD", "imgproxy", "health"]
      timeout: 10s
      interval: 10s
      retries: 3
    environment:
      - IMGPROXY_MAX_SRC_RESOLUTION=50.0
      - IMGPROXY_ALLOWED_SOURCES=s3://
      - IMGPROXY_USE_S3=true
      - IMGPROXY_S3_ENDPOINT=http://s3:9000
      - AWS_ACCESS_KEY_ID=root
      - AWS_SECRET_ACCESS_KEY=example-s3-key
    networks:
      - example

networks:
  example:

volumes:
  s3_data:
  postgres_data:

Secrets

The configuration will use the following secrets:

SecretValue
JWT Secretexample256bitlongsecretforjwtgen
Management API Tokenexample-management-token
Postgres Userpostgres
Postgres Passwordexample

Exposed ports

The configuration will expose the following ports on your local machine:

ServicePort
Postgres5432
Streams3001
Projections3002
CRUD3003
Auth3004
Deployments3005