From a496f75b8dbaf3f01f614d45814d795f10f2a414 Mon Sep 17 00:00:00 2001 From: Gerard Clos Date: Tue, 16 Jul 2024 12:31:01 +0200 Subject: [PATCH] feat: simplify dx bin/start.sh and forget about volumes crashing, high memory usage, and docker networking --- .tmuxinator.yml | 7 +++++ bin/start.sh | 26 +++++++++++++++++ docker-compose.yml | 70 ---------------------------------------------- 3 files changed, 33 insertions(+), 70 deletions(-) create mode 100644 .tmuxinator.yml create mode 100755 bin/start.sh diff --git a/.tmuxinator.yml b/.tmuxinator.yml new file mode 100644 index 000000000..5994caf23 --- /dev/null +++ b/.tmuxinator.yml @@ -0,0 +1,7 @@ +# ./.tmuxinator.yml + +name: latitude-llm +windows: + - web: cd apps/web + - apps: pnpm dev --filter='./apps/*' + - docker: docker compose up diff --git a/bin/start.sh b/bin/start.sh new file mode 100755 index 000000000..61e417d31 --- /dev/null +++ b/bin/start.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Install tmux +if ! command -v tmux &> /dev/null +then + if command -v brew &> /dev/null + then + brew install tmux + else + sudo apt-get install tmux -y + fi +fi + +# Install tmuxinator +if ! command -v tmuxinator &> /dev/null +then + if command -v brew &> /dev/null + then + brew install tmuxinator + else + sudo apt-get install tmuxinator -y + fi +fi + +# Have fun! +tmuxinator diff --git a/docker-compose.yml b/docker-compose.yml index 75a6befea..9b35e145f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,68 +5,12 @@ services: context: . dockerfile: docker/Dockerfile.base restart: 'none' - - web: - build: - context: . - target: dev-runner - dockerfile: apps/web/docker/Dockerfile - ports: - - '3000:3000' - - # Expose the Node.js debug port to the host. - - '9229:9229' - - '9230:9230' - volumes: - - ./packages/env:/app/packages/env - - ./packages/core:/app/packages/core - - ./packages/jobs:/app/packages/jobs - - ./packages/web-ui:/app/packages/web-ui - - ./apps/web:/app/apps/web - depends_on: - - base - - db - command: pnpm run dev - - api: - build: - context: . - dockerfile: apps/api/docker/Dockerfile - target: development - ports: - - '3001:3001' - volumes: - - ./packages/env:/app/packages/env - - ./packages/core:/app/packages/core - - ./packages/jobs:/app/packages/jobs - - ./apps/api:/app/apps/api - depends_on: - - base - - db - command: pnpm run dev - - core: - build: - context: . - dockerfile: packages/core/docker/Dockerfile - ports: - # Used to run Drizzle studio in development - - '3002:3002' - volumes: - - ./packages/core:/app/packages/core - - ./packages/env:/app/packages/env - depends_on: - - base - - db - command: pnpm db:studio - elastic: image: elasticsearch:8.14.1 environment: - 'discovery.type=single-node' - 'ELASTIC_USERNAME=latitude' - 'ELASTIC_PASSWORD=secret' - db: image: postgres environment: @@ -77,20 +21,6 @@ services: volumes: - ./docker/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh - ./docker/pgdata:/var/lib/postgresql/data - - jobs: - build: - context: . - dockerfile: packages/jobs/docker/Dockerfile - volumes: - - ./packages/env:/app/packages/env - - ./packages/core:/app/packages/core - - ./packages/jobs:/app/packages/jobs - depends_on: - - db - - redis - command: pnpm dev - redis: image: redis ports: