Skip to content

Commit 2acd600

Browse files
committed
chore: remove minification for backend and auth-service
1 parent d971b78 commit 2acd600

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

apps/auth-service/esbuild.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ esbuild
44
.build({
55
entryPoints: ["src/index.ts"],
66
bundle: true,
7-
minify: true,
7+
minify: false,
8+
sourcemap: true,
89
platform: "node",
910
outfile: "build/index.js",
1011
banner: {

apps/backend/Dockerfile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-alpine3.16 as base
1+
FROM node:20.18-alpine as base
22

33
ENV PNPM_HOME="/pnpm"
44
ENV PATH="$PNPM_HOME:$PATH"
@@ -31,16 +31,30 @@ COPY packages/auth /app/packages/auth/
3131

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

34+
35+
36+
FROM base AS installer
37+
WORKDIR /app
38+
39+
RUN apk update
40+
RUN apk add --no-cache libc6-compat
41+
42+
# First install the dependencies (as they change less often)
43+
COPY --from=builder /app/out/json/ .
3444
RUN pnpm install
45+
46+
# Build the project
47+
COPY --from=builder /app/out/full/ .
3548
RUN pnpm build --filter @codemod-com/backend
3649

50+
51+
3752
FROM base AS runner
3853
# Copy stuff for prisma to work
39-
COPY --from=builder /app/node_modules/.pnpm/@prisma+client@5.15.1_prisma@5.15.1/node_modules/.prisma/ ./node_modules/.pnpm/@prisma+client@5.15.1_prisma@5.15.1/node_modules/.prisma/
54+
COPY --from=installer /app/node_modules/.pnpm/@prisma+client@5.15.1_prisma@5.15.1/node_modules/.prisma/ ./node_modules/.pnpm/@prisma+client@5.15.1_prisma@5.15.1/node_modules/.prisma/
4055

4156
WORKDIR /app
42-
COPY --from=builder /app/apps/backend ./apps/backend
43-
COPY --from=builder /app/packages/database ./packages/database
57+
COPY --from=installer /app/apps/backend ./apps/backend
58+
COPY --from=installer /app/packages/database ./packages/database
4459

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

apps/backend/esbuild.config.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,9 @@ esbuild
44
.build({
55
entryPoints: ["src/index.ts"],
66
bundle: true,
7-
minify: true,
7+
minify: false,
88
platform: "node",
99
outfile: "build/index.js",
10-
banner: {
11-
js: `
12-
import { createRequire } from 'module';
13-
import { fileURLToPath, URL } from 'url';
14-
import path from 'path';
15-
const require = createRequire(import.meta.url);
16-
const __filename = fileURLToPath(import.meta.url);
17-
const __dirname = path.dirname(__filename);
18-
`,
19-
},
2010
format: "esm",
2111
})
2212
.catch(() => process.exit(1));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy