File tree Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 4
4
. build ( {
5
5
entryPoints : [ "src/index.ts" ] ,
6
6
bundle : true ,
7
- minify : true ,
7
+ minify : false ,
8
+ sourcemap : true ,
8
9
platform : "node" ,
9
10
outfile : "build/index.js" ,
10
11
banner : {
Original file line number Diff line number Diff line change 1
- FROM node:20-alpine3.16 as base
1
+ FROM node:20.18-alpine as base
2
2
3
3
ENV PNPM_HOME="/pnpm"
4
4
ENV PATH="$PNPM_HOME:$PATH"
@@ -31,16 +31,30 @@ COPY packages/auth /app/packages/auth/
31
31
32
32
RUN turbo prune @codemod-com/backend --docker
33
33
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/ .
34
44
RUN pnpm install
45
+
46
+ # Build the project
47
+ COPY --from=builder /app/out/full/ .
35
48
RUN pnpm build --filter @codemod-com/backend
36
49
50
+
51
+
37
52
FROM base AS runner
38
53
# 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/
40
55
41
56
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
44
59
45
60
CMD cd packages/database && pnpm dlx prisma@latest migrate deploy && cd - && node apps/backend/build/index.js
46
-
Original file line number Diff line number Diff line change 4
4
. build ( {
5
5
entryPoints : [ "src/index.ts" ] ,
6
6
bundle : true ,
7
- minify : true ,
7
+ minify : false ,
8
8
platform : "node" ,
9
9
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
- } ,
20
10
format : "esm" ,
21
11
} )
22
12
. catch ( ( ) => process . exit ( 1 ) ) ;
You can’t perform that action at this time.
0 commit comments