diff --git a/blueprints/rybbit/docker-compose.yml b/blueprints/rybbit/docker-compose.yml new file mode 100644 index 00000000..d2b854fa --- /dev/null +++ b/blueprints/rybbit/docker-compose.yml @@ -0,0 +1,112 @@ +# https://www.rybbit.io/docs/self-hosting-advanced + +services: + rybbit_clickhouse: + image: clickhouse/clickhouse-server:25.4.2 + volumes: + - clickhouse_data:/var/lib/clickhouse + - clickhouse_config:/etc/clickhouse-server/config.d + environment: + - CLICKHOUSE_DB=${CLICKHOUSE_DB} + - CLICKHOUSE_USER=${CLICKHOUSE_USER} + - CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD} + healthcheck: + test: + [ + "CMD", + "wget", + "--no-verbose", + "--tries=1", + "--spider", + "http://localhost:8123/ping", + ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s + restart: unless-stopped + networks: + - internal + + rybbit_postgres: + image: postgres:17.4 + environment: + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + volumes: + - postgres_data:/var/lib/postgresql/data + restart: unless-stopped + networks: + - internal + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 30s + timeout: 10s + retries: 3 + + rybbit_backend: + image: ghcr.io/rybbit-io/rybbit-backend:latest + environment: + - NODE_ENV=production + - CLICKHOUSE_HOST=http://rybbit_clickhouse:8123 + - CLICKHOUSE_DB=${CLICKHOUSE_DB} + - CLICKHOUSE_USER=${CLICKHOUSE_USER} + - CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD} + - POSTGRES_HOST=rybbit_postgres + - POSTGRES_PORT=5432 + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET} + - BASE_URL=${BASE_URL} + - DISABLE_SIGNUP=${DISABLE_SIGNUP} + depends_on: + rybbit_clickhouse: + condition: service_healthy + rybbit_postgres: + condition: service_started + restart: unless-stopped + networks: + - internal + - web + + rybbit_client: + image: ghcr.io/rybbit-io/rybbit-client:latest + environment: + - NODE_ENV=production + - NEXT_PUBLIC_BACKEND_URL=${BASE_URL} + - NEXT_PUBLIC_DISABLE_SIGNUP=${DISABLE_SIGNUP} + depends_on: + - rybbit_backend + restart: unless-stopped + networks: + - internal + - web + + rybbit_caddy: + image: caddy:2-alpine + networks: + - web + volumes: + - ../files/Caddyfile:/etc/caddy/Caddyfile:ro + environment: + - BASE_URL=":80" + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "--spider", "--quiet", "http://127.0.0.1:80"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s + +volumes: + clickhouse_data: + clickhouse_config: + postgres_data: + +networks: + web: + driver: bridge + internal: + driver: bridge diff --git a/blueprints/rybbit/rybbit.png b/blueprints/rybbit/rybbit.png new file mode 100644 index 00000000..ceacf8e9 Binary files /dev/null and b/blueprints/rybbit/rybbit.png differ diff --git a/blueprints/rybbit/template.toml b/blueprints/rybbit/template.toml new file mode 100644 index 00000000..27045d8c --- /dev/null +++ b/blueprints/rybbit/template.toml @@ -0,0 +1,41 @@ +[variables] +main_domain = "${domain}" +better_auth_secret = "${password:32}" +clickhouse_password = "${password:32}" +postgres_password = "${password:32}" + +[[config.domains]] +serviceName = "rybbit_caddy" +port = 80 +host = "${main_domain}" + +[config.env] +BASE_URL = "http://${main_domain}" +BETTER_AUTH_SECRET = "${better_auth_secret}" +DISABLE_SIGNUP = "false" +CLICKHOUSE_DB = "analytics" +CLICKHOUSE_USER = "default" +CLICKHOUSE_PASSWORD = "${clickhouse_password}" +POSTGRES_DB = "analytics" +POSTGRES_USER = "frog" +POSTGRES_PASSWORD = "${postgres_password}" + +[[config.mounts]] +filePath = "./Caddyfile" +content = """ +{$BASE_URL} { + route { + @api path /api/* + uri @api strip_prefix /api + reverse_proxy @api http://rybbit_backend:3001 { + header_up Host {http.reverse_proxy.upstream.hostport} + header_up X-Real-IP {http.request.header.X-Real-IP} + } + + reverse_proxy http://rybbit_client:3002 { + header_up Host {http.reverse_proxy.upstream.hostport} + header_up X-Real-IP {http.request.header.X-Real-IP} + } + } +} +""" diff --git a/meta.json b/meta.json index 427f3286..66801852 100644 --- a/meta.json +++ b/meta.json @@ -2308,5 +2308,18 @@ "database", "search" ] + }, + { + "id": "rybbit", + "name": "Rybbit", + "version": "latest", + "description": "Open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive", + "logo": "rybbit.png", + "links": { + "github": "https://github.com/rybbit-io/rybbit", + "website": "https://rybbit.io", + "docs": "https://www.rybbit.io/docs" + }, + "tags": ["analytics"] } ]