Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun support #73

Open
Igloczek opened this issue Jul 31, 2024 · 0 comments
Open

Bun support #73

Igloczek opened this issue Jul 31, 2024 · 0 comments

Comments

@Igloczek
Copy link

I'm shipping my app using Docker, to ARM-based (Ampere Altra) machine, so it's linux/arm64 platform target.
The app is based on Bun and has bullmq dependency.

I believe because of this shebang just to install dependencies while building a Docker image based on oven/bun it forces users to also have Node.js installed, which is not an ideal scenario, because the error you get there, won't tell you that straight away, it took me good few hours to figure it out.

It looks like instead of using exec you can just import the build-test.js and execute it as normal JS code, which makes it compatible with any runtime, but that's just a guess after looking at this code for like 3 min 😅

Also I'm not sure if I'm reporting this issue in the right place, as in my case it was from node-gyp-optional-packages, but repo in package.json points there and the code looks almost the same.

If someone end there looking for solution, this is the Dockerfile I end with

FROM oven/bun:1.1.21 as base
RUN apt-get update && apt-get install -y curl python3 build-essential

FROM base as builder

SHELL ["/bin/bash", "--login", "-c"]
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
RUN nvm install --lts

WORKDIR /usr/src/app
COPY . .
RUN bun install --production

FROM base
COPY --from=builder /usr/src/app .

USER bun
ENV NODE_ENV=production
EXPOSE 4000/tcp
ENTRYPOINT [ "bun", "run", "src/main.ts" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant