Convex
Convex is the open-source reactive database designed to make life easy for web app developers, whether human or LLM. Fetch data and perform business logic with strong consistency by writing pure TypeScript.
References
Section titled “References”Make directory
Section titled “Make directory”mkdir -p {{DOCKER_PATH_VAR}}/convex && cd {{DOCKER_PATH_VAR}}/convexcompose.yml
Section titled “compose.yml”nano compose.ymlservices: backend: image: ghcr.io/get-convex/convex-backend:latest env_file: .env stop_grace_period: 10s stop_signal: SIGINT ports: - "${PORT:-3210}:3210" - "${SITE_PROXY_PORT:-3211}:3211" volumes: - data:/convex/data healthcheck: test: curl -f http://localhost:3210/version interval: 5s start_period: 10s depends_on: postgres: condition: service_healthy
dashboard: image: ghcr.io/get-convex/convex-dashboard:latest env_file: .env environment: - PORT=6791 - HOST=0.0.0.0 stop_grace_period: 10s stop_signal: SIGINT ports: - "${DASHBOARD_PORT:-6791}:6791" depends_on: backend: condition: service_healthy
postgres: image: postgres:17-alpine restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 3s retries: 5
volumes: data: pgdata:nano .env# PortsPORT=3210SITE_PROXY_PORT=3211DASHBOARD_PORT=6791
# POSTGRESPOSTGRES_USER=postgresPOSTGRES_PASSWORD=postgresPOSTGRES_DB=convexPOSTGRES_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432
# Required Convex environment variablesINSTANCE_NAME=${POSTGRES_DB}INSTANCE_SECRET=your-secret # openssl rand -hex 32CONVEX_RELEASE_VERSION_DEV=ACTIONS_USER_TIMEOUT_SECS=30CONVEX_CLOUD_ORIGIN=http://localhost:3210CONVEX_SITE_ORIGIN=http://localhost:3211DATABASE_URL=${POSTGRES_URL}DISABLE_BEACON=1REDACT_LOGS_TO_CLIENT=1DO_NOT_REQUIRE_SSL=1RUST_LOG=infoRUST_BACKTRACE=1NEXT_PUBLIC_DEPLOYMENT_URL=http://localhost:3210Start container
Section titled “Start container”docker compose up -dGenerate admin keys
Section titled “Generate admin keys”docker compose exec backend ./generate_admin_key.sh.env.local
Section titled “.env.local”nano .env.localCONVEX_SELF_HOSTED_URL=http://localhost:3210CONVEX_SELF_HOSTED_ADMIN_KEY=your-convex-admin-key