bun icon indicating copy to clipboard operation
bun copied to clipboard

Remix Docker Issues

Open lauhon opened this issue 1 year ago • 2 comments

What version of Bun is running?

1.0.14+d8be3e51b

What platform is your computer?

Darwin 23.1.0 arm64 arm

What steps can reproduce the bug?

  1. bun create remix
  2. Change renderToPipeableStream import in entry.server.tsx to import { renderToPipeableStream } from "react-dom/server.node"; (Without this the docker build is crashing. That also comes up in this Issue)
  3. Add "normal" Dockerfile:
Dockerfile
FROM oven/bun:1 as base
WORKDIR /usr/src/app

# Install dependencies and cache
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile --ignore-scripts 


# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production --ignore-scripts 

# Copy node modules from dev to prod
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .

ENV NODE_ENV=production
RUN bun run build

FROM base AS release
ENV NODE_ENV=production

COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/app/build build
COPY --from=prerelease /usr/src/app/public public
COPY --from=prerelease /usr/src/app/package.json .
ADD . .


CMD [ "bun", "start" ]
  1. docker build -t my-app . & docker run -p 3000:3000 my-app

What is the expected behavior?

Website is working in Browser

Remix log

$ remix-serve ./build/index.js
[remix-serve] http://localhost:3000/ (http://172.17.0.2:3000/)
Expected a Response object
GET / - - - 14.717 ms

What do you see instead?

When visiting localhost the browser behaves very strangely, if I visit localhost on a tab that has another page open, the request just refreshes the old page. If I try to visit localhost from a new tab, it just clears the address bar and does nothing.

Additional information

No response

lauhon avatar Dec 13 '23 09:12 lauhon

Hey @Electroid, did you have time to investigate this?

Would really love to use bun for a small prod app at my job, but this is holding me back.

lauhon avatar Jan 08 '24 06:01 lauhon

yeah this and prisma generate not working in docker are huge bummers for me... if these two issues were solved (https://github.com/oven-sh/bun/issues/5320) then i could actually use bun after spending a few hours making tweaks to fix other problems... its too bad because bun is so fast but a lot of common libraries just dont work

zackify avatar Feb 10 '24 20:02 zackify

Having same problem. It seems related with : https://github.com/oven-sh/bun/issues/9949

quentindutot avatar May 28 '24 09:05 quentindutot

bumping- same issue here

davidgamero avatar Jun 11 '24 22:06 davidgamero