From 07012ca19c0e33033d30494aecefed5bfde2fd02 Mon Sep 17 00:00:00 2001 From: chand1012 Date: Sat, 4 May 2024 15:12:17 -0400 Subject: [PATCH] Add docker compose file for self hosting --- .env.example | 16 ++++++++++++ docker-compose.yaml | 64 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .env.example create mode 100644 docker-compose.yaml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e95ead0 --- /dev/null +++ b/.env.example @@ -0,0 +1,16 @@ +NUM_WORKERS_PER_QUEUE=8 +OPENAI_API_KEY= +SLACK_WEBHOOK_URL= +SERPER_API_KEY= +LLAMAPARSE_API_KEY= +LOGTAIL_KEY= +BULL_AUTH_KEY= +TEST_API_KEY= +POSTHOG_API_KEY= +POSTHOG_HOST= +SUPABASE_ANON_TOKEN= +SUPABASE_URL= +SUPABASE_SERVICE_TOKEN= +SCRAPING_BEE_API_KEY= +USE_DB_AUTHENTICATION=false +SELFHOST_API_KEY= diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..c65de3f --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,64 @@ +name: firecrawl +version: '3.9' +services: + redis: + image: redis:alpine + + playwright-service: + build: apps/playwright-service + environment: + - PORT=3000 + + api: + build: apps/api + environment: + - REDIS_URL=redis://redis:6379 + - PLAYWRIGHT_SERVICE_URL=http://playwright-service:3000 + - USE_DB_AUTHENTICATION=${USE_DB_AUTHENTICATION} + - PORT=3002 + - NUM_WORKERS_PER_QUEUE=${NUM_WORKERS_PER_QUEUE} + - OPENAI_API_KEY=${OPENAI_API_KEY} + - SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} + - SERPER_API_KEY=${SERPER_API_KEY} + - LLAMAPARSE_API_KEY=${LLAMAPARSE_API_KEY} + - LOGTAIL_KEY=${LOGTAIL_KEY} + - BULL_AUTH_KEY=${BULL_AUTH_KEY} + - TEST_API_KEY=${TEST_API_KEY} + - POSTHOG_API_KEY=${POSTHOG_API_KEY} + - POSTHOG_HOST=${POSTHOG_HOST} + - SUPABASE_ANON_TOKEN=${SUPABASE_ANON_TOKEN} + - SUPABASE_URL=${SUPABASE_URL} + - SUPABASE_SERVICE_TOKEN=${SUPABASE_SERVICE_TOKEN} + - SCRAPING_BEE_API_KEY=${SCRAPING_BEE_API_KEY} + - HOST=0.0.0.0 + depends_on: + - redis + - playwright-service + ports: + - "3002:3002" + command: [ "pnpm", "run", "start:production" ] + + worker: + build: apps/api + environment: + - REDIS_URL=redis://redis:6379 + - PLAYWRIGHT_SERVICE_URL=http://playwright-service:3000 + - USE_DB_AUTHENTICATION=${USE_DB_AUTHENTICATION} + - PORT=3002 + - NUM_WORKERS_PER_QUEUE=${NUM_WORKERS_PER_QUEUE} + - OPENAI_API_KEY=${OPENAI_API_KEY} + - SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} + - SERPER_API_KEY=${SERPER_API_KEY} + - LLAMAPARSE_API_KEY=${LLAMAPARSE_API_KEY} + - LOGTAIL_KEY=${LOGTAIL_KEY} + - BULL_AUTH_KEY=${BULL_AUTH_KEY} + - TEST_API_KEY=${TEST_API_KEY} + - POSTHOG_API_KEY=${POSTHOG_API_KEY} + - POSTHOG_HOST=${POSTHOG_HOST} + - SUPABASE_ANON_TOKEN=${SUPABASE_ANON_TOKEN} + - SUPABASE_URL=${SUPABASE_URL} + - SUPABASE_SERVICE_TOKEN=${SUPABASE_SERVICE_TOKEN} + - SCRAPING_BEE_API_KEY=${SCRAPING_BEE_API_KEY} + depends_on: + - redis + - playwright-service