File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 1
- FROM oven/bun:slim
1
+ FROM oven/bun:1.2.5 AS base
2
+ WORKDIR /usr/src/app
2
3
3
- WORKDIR /app
4
+ FROM base AS install
5
+ COPY package.json bun.lock ./
6
+ RUN bun install --frozen-lockfile --production
4
7
5
- COPY package*.json ./
6
8
7
- RUN bun install
8
-
9
- COPY src ./src
10
- COPY tsconfig.json ./
11
-
12
- EXPOSE 4141
9
+ FROM base AS prerelease
10
+ COPY --from=install /usr/src/app/node_modules node_modules
11
+ COPY . .
13
12
14
13
ENV NODE_ENV=production
14
+ RUN bun test
15
+ RUN bun run build
16
+
17
+ FROM base AS release
18
+ COPY --from=install /usr/src/app/node_modules node_modules
19
+ COPY --from=prerelease /usr/src/app/dist/ .
15
20
16
- CMD ["bun" , "run" , "start" ]
21
+ USER bun
22
+ EXPOSE 4141/tcp
23
+ ENTRYPOINT [ "bun" , "main.js" ]
Original file line number Diff line number Diff line change 27
27
"knip" : " knip-bun" ,
28
28
"lint" : " eslint ." ,
29
29
"prepack" : " bun run build" ,
30
- "prepare" : " simple-git-hooks" ,
30
+ "prepare" : " NODE_ENV=production || simple-git-hooks" ,
31
31
"release" : " bumpp && bun publish --access public" ,
32
32
"start" : " NODE_ENV=production bun run ./src/main.ts"
33
33
},
You can’t perform that action at this time.
0 commit comments