From 9c639bc1b7ac6ad0e887fb4a5db941a1f5adba14 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 30 Nov 2024 13:38:27 +1030 Subject: [PATCH] chore: Add self-host docker file (#169) --- control-plane/README.md | 2 +- ...ompose.dev.yml => docker-compose.base.yml} | 24 -------- control-plane/docker-compose.hobby.yml | 58 +++++++++++++++++++ control-plane/docker-compose.yml | 38 ++++++++++++ 4 files changed, 97 insertions(+), 25 deletions(-) rename control-plane/{docker-compose.dev.yml => docker-compose.base.yml} (56%) create mode 100644 control-plane/docker-compose.hobby.yml create mode 100644 control-plane/docker-compose.yml diff --git a/control-plane/README.md b/control-plane/README.md index 800fe8b2..78e581b3 100644 --- a/control-plane/README.md +++ b/control-plane/README.md @@ -27,7 +27,7 @@ To run the control plane locally for development: 1. Start the local resources required for development: ```bash -docker compose -f docker-compose.dev.yml up +docker compose up ``` This will start: diff --git a/control-plane/docker-compose.dev.yml b/control-plane/docker-compose.base.yml similarity index 56% rename from control-plane/docker-compose.dev.yml rename to control-plane/docker-compose.base.yml index 0c07cc1e..34940603 100644 --- a/control-plane/docker-compose.dev.yml +++ b/control-plane/docker-compose.base.yml @@ -1,5 +1,3 @@ -version: '3.9' - services: postgres: image: pgvector/pgvector:pg16 @@ -8,41 +6,19 @@ services: POSTGRES_USER: inferable POSTGRES_PASSWORD: inferable POSTGRES_DB: inferable - ports: - - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data redis: image: redis container_name: redis - ports: - - "6379:6379" elasticmq: image: softwaremill/elasticmq-native container_name: elasticmq - ports: - - "9324:9324" - - "9325:9325" configs: - source: elasticmq_conf target: /opt/elasticmq.conf volumes: - elasticmqdata:/data -volumes: - pgdata: - elasticmqdata: - -configs: - elasticmq_conf: - content: | - include classpath("application.conf") - - queues { - run-process {} - run-generate-name {} - customer-telemetry {} - external-tool-call {} - } diff --git a/control-plane/docker-compose.hobby.yml b/control-plane/docker-compose.hobby.yml new file mode 100644 index 00000000..80d26e80 --- /dev/null +++ b/control-plane/docker-compose.hobby.yml @@ -0,0 +1,58 @@ +services: + control-plane: + image: inferable/control-plane:latest + container_name: control-plane + depends_on: + - postgres + - redis + - elasticmq + ports: + - "4000:4000" + environment: + DATABASE_URL: "postgresql://inferable:inferable@postgres:5432/inferable" + DATABASE_SSL_DISABLED: "true" + REDIS_URL: "redis://redis:6379" + # Required for elasticmq + AWS_REGION: "us-east-1" + AWS_ACCESS_KEY_ID: "PLACEHOLDER" + AWS_SECRET_ACCESS_KEY: "PLACEHOLDER" + SQS_BASE_QUEUE_URL: 'http://elasticmq:9324/000000000000' + SQS_RUN_PROCESS_QUEUE_URL: 'http://elasticmq:9324/000000000000/run-process' + SQS_RUN_GENERATE_NAME_QUEUE_URL: 'http://elasticmq:9324/000000000000/run-generate-name' + SQS_CUSTOMER_TELEMETRY_QUEUE_URL: 'http://elasticmq:9324/000000000000/customer-telemetry' + SQS_EXTERNAL_TOOL_CALL_QUEUE_URL: 'http://elasticmq:9324/000000000000/external-tool-call' + MANAGEMENT_API_SECRET: ${MANAGEMENT_API_SECRET} + ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY} + COHERE_API_KEY: ${COHERE_API_KEY} + + + postgres: + extends: + file: docker-compose.base.yml + service: postgres + + redis: + extends: + file: docker-compose.base.yml + service: redis + + elasticmq: + extends: + file: docker-compose.base.yml + service: elasticmq + +volumes: + pgdata: + elasticmqdata: + +configs: + elasticmq_conf: + content: | + include classpath("application.conf") + + queues { + run-process {} + run-generate-name {} + customer-telemetry {} + external-tool-call {} + } diff --git a/control-plane/docker-compose.yml b/control-plane/docker-compose.yml new file mode 100644 index 00000000..0bb757da --- /dev/null +++ b/control-plane/docker-compose.yml @@ -0,0 +1,38 @@ +services: + postgres: + extends: + file: docker-compose.base.yml + service: postgres + ports: + - "5432:5432" + + redis: + extends: + file: docker-compose.base.yml + service: redis + ports: + - "6379:6379" + + elasticmq: + extends: + file: docker-compose.base.yml + service: elasticmq + ports: + - "9324:9324" + - "9325:9325" + +volumes: + pgdata: + elasticmqdata: + +configs: + elasticmq_conf: + content: | + include classpath("application.conf") + + queues { + run-process {} + run-generate-name {} + customer-telemetry {} + external-tool-call {} + }