-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to bun as a runner and package manager
- Loading branch information
Daniel Haarhoff
committed
May 9, 2024
1 parent
b59b7b5
commit 3952f70
Showing
7 changed files
with
25 additions
and
14,329 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[tools] | ||
node = "18" | ||
bun = "latest" |
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,23 +1,33 @@ | ||
# BASE | ||
FROM node:18-slim@sha256:cbfb3c9830932b7b1c2738abf47c66568fc7b06cf782d803e7ddff52b2fc835d as node | ||
WORKDIR /app | ||
COPY package*.json ./ | ||
COPY package.json ./ | ||
|
||
FROM oven/bun:1 as bun | ||
WORKDIR /app | ||
COPY package.json ./ | ||
COPY bun.lockb ./ | ||
|
||
# DEV | ||
FROM bun as dev-deps | ||
RUN bun install --frozen-lockfile | ||
|
||
FROM node as dev | ||
RUN npm ci | ||
COPY --from=dev-deps /app/node_modules/ node_modules/ | ||
COPY ./tsconfig.json . | ||
CMD [ "npx", "ts-node-dev", "--transpile-only", "--respawn", "./src/index.ts" ] | ||
|
||
# PROD | ||
FROM node as prod-npm | ||
RUN npm ci --production | ||
FROM bun as prod-deps | ||
RUN bun install --frozen-lockfile --production | ||
|
||
FROM dev as prod-build | ||
COPY ./src src/ | ||
RUN npx tsc | ||
|
||
FROM prod-npm as prod | ||
FROM node as prod | ||
COPY --from=prod-deps /app/node_modules node_modules/ | ||
COPY --from=prod-build /app/build/ build/ | ||
COPY ./src/static build/src/static/ | ||
RUN ls -l | ||
CMD ["node", "build/src/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
Oops, something went wrong.