Skip to content

Commit

Permalink
chore: remove minification for backend and auth-service
Browse files Browse the repository at this point in the history
  • Loading branch information
mohebifar committed Dec 22, 2024
1 parent d971b78 commit 0b76ac5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
3 changes: 2 additions & 1 deletion apps/auth-service/esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ esbuild
.build({
entryPoints: ["src/index.ts"],
bundle: true,
minify: true,
minify: false,
sourcemap: true,
platform: "node",
outfile: "build/index.js",
banner: {
Expand Down
22 changes: 18 additions & 4 deletions apps/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,30 @@ COPY packages/auth /app/packages/auth/

RUN turbo prune @codemod-com/backend --docker



FROM base AS installer
WORKDIR /app

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/backend



FROM base AS runner
# Copy stuff for prisma to work
COPY --from=builder /app/node_modules/.pnpm/@[email protected][email protected]/node_modules/.prisma/ ./node_modules/.pnpm/@[email protected][email protected]/node_modules/.prisma/
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=builder /app/apps/backend ./apps/backend
COPY --from=builder /app/packages/database ./packages/database
COPY --from=installer /app/apps/backend ./apps/backend
COPY --from=installer /app/packages/database ./packages/database

CMD cd packages/database && pnpm dlx prisma@latest migrate deploy && cd - && node apps/backend/build/index.js

2 changes: 1 addition & 1 deletion apps/backend/esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ esbuild
.build({
entryPoints: ["src/index.ts"],
bundle: true,
minify: true,
minify: false,
platform: "node",
outfile: "build/index.js",
banner: {
Expand Down

0 comments on commit 0b76ac5

Please sign in to comment.