From 7e30407b1777c92bad7c4c1341139cea01236a64 Mon Sep 17 00:00:00 2001 From: Ryan Liu Date: Thu, 12 Oct 2023 11:48:44 -0700 Subject: [PATCH] Revert "chore: use docker compose watch for local dev (#1717)" This reverts commit e3ed2585a8529d97f9e9ec286f8985908034f81c. --- Dockerfile.dev | 20 ----------------- apps/api/index.ts | 2 +- depot.json | 1 - docker-compose.yml | 53 ++++++++++------------------------------------ 4 files changed, 12 insertions(+), 64 deletions(-) delete mode 100644 Dockerfile.dev delete mode 100644 depot.json diff --git a/Dockerfile.dev b/Dockerfile.dev deleted file mode 100644 index ae5a76d35..000000000 --- a/Dockerfile.dev +++ /dev/null @@ -1,20 +0,0 @@ -FROM node:18-bullseye-slim AS base - -FROM base AS builder -ARG APP -WORKDIR /workspace -RUN yarn global add turbo -COPY . . -RUN --mount=type=cache,mode=0777,target=/workspace/.yarn/cache turbo prune --scope=${APP} --docker - -# Add lockfile and package.json's of isolated subworkspace -FROM base AS dev -WORKDIR /workspace - -# First install dependencies (as they change less often) -COPY . . -COPY .yarnrc.build.yml .yarnrc.yml -COPY .yarn .yarn -COPY --from=builder /workspace/out/json/ . -COPY --from=builder /workspace/out/yarn.lock ./yarn.lock -RUN yarn install diff --git a/apps/api/index.ts b/apps/api/index.ts index 564f3d06e..02c7533fa 100644 --- a/apps/api/index.ts +++ b/apps/api/index.ts @@ -219,7 +219,7 @@ createTerminus(server, { return; }, }, - timeout: process.env.ENVIRONMENT === 'development' ? 0 : 10000, + timeout: 10000, beforeShutdown: async () => { logger.info('Server is shutting down'); metricsServer.close(); diff --git a/depot.json b/depot.json deleted file mode 100644 index 4c2bf2e70..000000000 --- a/depot.json +++ /dev/null @@ -1 +0,0 @@ -{"id":"njz6kvt3dk"} diff --git a/docker-compose.yml b/docker-compose.yml index 0a386fdc0..846eef962 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,11 +45,7 @@ services: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-supaglue} api: - build: - context: . - dockerfile: ./Dockerfile.dev - args: - - APP=api + image: node:18-bullseye ports: - '8080:8080' depends_on: @@ -57,21 +53,9 @@ services: condition: service_started init: condition: service_completed_successfully - working_dir: /workspace - develop: - watch: - - action: sync - path: ./apps/api - target: /workspace/apps/api - ignore: - - node_modules/ - - action: sync - path: ./packages - target: /workspace/packages - - action: rebuild - path: package.json - - action: rebuild - path: ./apps/api/package.json + volumes: + - .:/app + working_dir: /app environment: <<: [*common-env, *fe-api-common-env] SUPAGLUE_API_PORT: ${SUPAGLUE_API_PORT:-8080} @@ -79,38 +63,22 @@ services: SUPAGLUE_SYNC_PERIOD_MS: ADMIN_PASSWORD: ${ADMIN_PASSWORD:-admin} restart: on-failure - command: /bin/sh -c "yarn workspace api start" + command: /bin/sh -c "./apps/api/scripts/start_dev.sh" sync-worker: - build: - context: . - dockerfile: ./Dockerfile.dev - args: - - APP=sync-worker + image: node:18-bullseye depends_on: postgres: condition: service_started init: condition: service_completed_successfully - working_dir: /workspace - develop: - watch: - - action: sync - path: ./apps/sync-worker - target: /workspace/apps/sync-worker - ignore: - - node_modules/ - - action: sync - path: ./packages - target: /workspace/packages - - action: rebuild - path: package.json - - action: rebuild - path: ./apps/sync-worker/package.json + volumes: + - .:/app + working_dir: /app environment: <<: *common-env restart: on-failure - command: /bin/sh -c "yarn workspace sync-worker start" + command: /bin/sh -c "./apps/sync-worker/scripts/start_dev.sh" temporal: image: alpine:3.18.0 @@ -141,6 +109,7 @@ services: - sh - -c - | + yarn install yarn workspace @supaglue/db prisma migrate dev yarn workspace @supaglue/db prisma db seed yarn workspace api init-temporal