diff options
-rw-r--r-- | Dockerfile | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Dockerfile b/Dockerfile index 915a6a9..3724bf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,9 @@ COPY --link static static ENV NODE_ENV=production RUN bun run bin/build.ts +RUN rm -fr node_modules +COPY --from=install /temp/prod/node_modules node_modules +RUN bun build src/index.ts --compile --minify --sourcemap --outfile server FROM alpine:20240329 as postprocess @@ -47,11 +50,12 @@ RUN make format RUN make -j4 compress # Final stage for app image -FROM base +FROM gcr.io/distroless/base-nossl + +WORKDIR /app # Copy built application COPY config.toml /app/ -COPY --from=install /temp/prod/node_modules node_modules COPY --from=build /app /app COPY --from=postprocess /app/public /app/public @@ -60,4 +64,4 @@ EXPOSE 3000 EXPOSE 9091 ENV NODE_ENV=production -CMD [ "bun", "run", "src/index.ts" ] +CMD [ "/app/server" ] |