Skip to content

Commit

Permalink
Added support for Bun executables.
Browse files Browse the repository at this point in the history
  • Loading branch information
rudimk committed Nov 26, 2024
1 parent 1f96195 commit 8d52349
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ COPY . .
# [optional] tests & build
ENV NODE_ENV=production
RUN bun test
RUN bun run build

# copy production dependencies and source code into final image
# copy production app into the final image
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/app/index.ts .
COPY --from=prerelease /usr/src/app/package.json .
COPY --from=prerelease /usr/src/app/app .

# run the app
USER bun
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "run", "index.ts" ]
ENTRYPOINT [ "./app" ]
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"name": "bun-getting-started",
"module": "index.ts",
"type": "module",
"scripts": {
"dev": "bun run --watch index.ts",
"build": "bun build index.ts --target bun --compile --outfile app"
},
"devDependencies": {
"@types/bun": "latest"
},
Expand Down

0 comments on commit 8d52349

Please sign in to comment.