-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backend]: Fixed Insights build issues and Dockerfiles
- Loading branch information
Showing
19 changed files
with
85 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,60 @@ | ||
FROM node:20-alpine3.16 as builder | ||
FROM node:20-alpine3.16 AS base | ||
|
||
WORKDIR /app | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
|
||
RUN npm install -g pnpm | ||
RUN npm install -g pnpm@latest | ||
RUN pnpm -g add turbo@^1 | ||
|
||
COPY ./package.json ./turbo.json ./pnpm-workspace.yaml ./pnpm-lock.yaml /app/ | ||
COPY ./apps/run-service/package.json /app/apps/run-service/ | ||
|
||
COPY ./packages/tsconfig /app/packages/tsconfig/ | ||
COPY ./packages/utilities /app/packages/utilities/ | ||
COPY ./packages/filemod /app/packages/filemod/ | ||
|
||
RUN pnpm install | ||
FROM base AS builder | ||
WORKDIR /app | ||
|
||
COPY ./apps/run-service/tsconfig.json /app/apps/run-service/ | ||
COPY ./apps/run-service/esbuild.config.js /app/apps/run-service/ | ||
COPY ./apps/run-service/src /app/apps/run-service/src/ | ||
RUN apk update | ||
RUN apk add --no-cache libc6-compat | ||
|
||
RUN pnpm build --filter @codemod-com/utilities --filter @codemod-com/run-service | ||
COPY package.json turbo.json pnpm-workspace.yaml pnpm-lock.yaml /app/ | ||
COPY apps/run-service /app/apps/run-service/ | ||
|
||
FROM node:20-alpine3.16 | ||
COPY packages/tsconfig /app/packages/tsconfig/ | ||
COPY packages/utilities /app/packages/utilities/ | ||
COPY packages/filemod /app/packages/filemod/ | ||
COPY packages/telemetry /app/packages/telemetry/ | ||
COPY packages/database /app/packages/database/ | ||
COPY packages/runner /app/packages/runner/ | ||
COPY packages/printer /app/packages/printer/ | ||
COPY packages/workflow /app/packages/workflow/ | ||
COPY packages/api-types /app/packages/api-types/ | ||
COPY packages/codemod-utils /app/packages/codemod-utils/ | ||
COPY packages/auth /app/packages/auth/ | ||
|
||
RUN npm install -g pnpm | ||
RUN turbo prune @codemod-com/run-service --docker | ||
|
||
|
||
|
||
FROM base AS installer | ||
WORKDIR /app | ||
|
||
COPY --from=builder /app/apps/run-service/package.json /app | ||
COPY --from=builder /app/apps/run-service/build /app/build | ||
COPY --from=builder /app/packages /app/packages | ||
RUN apk update | ||
RUN apk add --no-cache libc6-compat | ||
|
||
# First install the dependencies (as they change less often) | ||
COPY --from=builder /app/out/json/ . | ||
RUN pnpm install | ||
|
||
# Build the project | ||
COPY --from=builder /app/out/full/ . | ||
RUN pnpm build --filter @codemod-com/run-service | ||
|
||
|
||
EXPOSE 8086 | ||
|
||
CMD node build/index.js | ||
FROM base AS runner | ||
# Copy stuff for prisma to work | ||
COPY --from=installer /app/node_modules/.pnpm/@[email protected][email protected]/node_modules/.prisma/ ./node_modules/.pnpm/@[email protected][email protected]/node_modules/.prisma/ | ||
|
||
WORKDIR /app | ||
COPY --from=installer /app/apps/run-service ./apps/run-service | ||
COPY --from=installer /app/packages/database ./packages/database | ||
|
||
CMD cd packages/database && pnpm dlx prisma@latest migrate deploy && cd - && node apps/run-service/build/index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
export * from "./campaign.js"; | ||
export * from "./clerk.js"; | ||
export * from "./codemod-run.js"; | ||
export * from "./errors.js"; | ||
export * from "./github.js"; | ||
export * from "./insights.js"; | ||
export * from "./responses.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.