From 1c65788cc24cc35331e17acd55fb5daaa0d482a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20B=C3=A4rtschi?= Date: Sun, 23 Feb 2025 11:44:21 +0100 Subject: [PATCH] this fixed the docker container for some reason --- Dockerfile | 9 +++------ src/index.tsx | 5 ++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a697ac..aba27a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,6 @@ WORKDIR /usr/src/app # install dependencies into temp directory # this will cache them and speed up future builds FROM base AS install -RUN mkdir -p /temp/dev -COPY package.json bun.lock /temp/dev/ -RUN cd /temp/dev && bun install --frozen-lockfile # install with --production (exclude devDependencies) RUN mkdir -p /temp/prod @@ -18,7 +15,7 @@ RUN cd /temp/prod && bun install --frozen-lockfile --production # copy node_modules from temp directory # then copy all (non-ignored) project files into the image FROM base AS prerelease -COPY --from=install /temp/dev/node_modules node_modules +COPY --from=install /temp/prod/node_modules node_modules COPY . . ENV NODE_ENV=production @@ -29,10 +26,10 @@ 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/build/ . +COPY --from=prerelease /usr/src/app/build/ ./build COPY --from=prerelease /usr/src/app/static/ ./static # run the app USER bun EXPOSE 3000 -ENTRYPOINT [ "bun", "run", "index.js" ] +ENTRYPOINT [ "bun", "run", "build/index.js" ] diff --git a/src/index.tsx b/src/index.tsx index 39bca31..28a7f0f 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -26,4 +26,7 @@ app.get("/accounts", c => { ); }); -export default app; +export default { + port: 3000, + fetch: app.fetch, +};