mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-21 00:58:29 -06:00
81 lines
2.5 KiB
YAML
81 lines
2.5 KiB
YAML
services:
|
|
# PostgreSQL must load the vector library so Hub (and Formbricks) can use the pgvector extension.
|
|
postgres:
|
|
image: pgvector/pgvector:pg18
|
|
volumes:
|
|
- postgres:/var/lib/postgresql/data
|
|
- ./docker/postgres-init-dev:/docker-entrypoint-initdb.d:ro
|
|
environment:
|
|
- POSTGRES_DB=postgres
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
ports:
|
|
- 5432:5432
|
|
command: >
|
|
postgres
|
|
-c shared_preload_libraries=vector
|
|
|
|
mailhog:
|
|
image: arjenz/mailhog
|
|
ports:
|
|
- 8025:8025
|
|
- 1025:1025
|
|
|
|
valkey:
|
|
image: valkey/valkey@sha256:12ba4f45a7c3e1d0f076acd616cb230834e75a77e8516dde382720af32832d6d
|
|
command: "valkey-server"
|
|
ports:
|
|
- 6379:6379
|
|
volumes:
|
|
- valkey-data:/data
|
|
|
|
minio:
|
|
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
- MINIO_ROOT_USER=devminio
|
|
- MINIO_ROOT_PASSWORD=devminio123
|
|
ports:
|
|
- "9000:9000" # S3 API direct access
|
|
- "9001:9001" # Web console
|
|
volumes:
|
|
- minio-data:/data
|
|
|
|
# Run Hub DB migrations (goose + river) before the API starts. Idempotent; runs on every compose up.
|
|
hub-migrate:
|
|
image: ghcr.io/formbricks/hub:latest
|
|
restart: "no"
|
|
entrypoint: ["sh", "-c"]
|
|
command: ["if [ -x /usr/local/bin/goose ] && [ -x /usr/local/bin/river ]; then /usr/local/bin/goose -dir /app/migrations postgres \"$$DATABASE_URL\" up && /usr/local/bin/river migrate-up --database-url \"$$DATABASE_URL\"; else echo 'Migration tools (goose/river) not in image, skipping migrations.'; fi"]
|
|
environment:
|
|
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public&sslmode=disable
|
|
depends_on:
|
|
- postgres
|
|
|
|
# Formbricks Hub API (ghcr.io/formbricks/hub). Shares the same Postgres database as Formbricks by default.
|
|
hub:
|
|
image: ghcr.io/formbricks/hub:latest
|
|
depends_on:
|
|
hub-migrate:
|
|
condition: service_completed_successfully
|
|
ports:
|
|
- "8080:8080"
|
|
environment:
|
|
API_KEY: ${HUB_API_KEY:-dev-api-key}
|
|
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public&sslmode=disable
|
|
# Explicit Postgres env so migrations and any libpq fallback use the service host, not localhost
|
|
PGHOST: postgres
|
|
PGPORT: "5432"
|
|
PGUSER: postgres
|
|
PGPASSWORD: postgres
|
|
PGDATABASE: postgres
|
|
PGSSLMODE: disable
|
|
|
|
volumes:
|
|
postgres:
|
|
driver: local
|
|
valkey-data:
|
|
driver: local
|
|
minio-data:
|
|
driver: local
|