From 93a4c5c9bc0f6c1c32312701928d9323a90f40f4 Mon Sep 17 00:00:00 2001 From: xamey Date: Mon, 18 Nov 2024 13:46:52 +0100 Subject: [PATCH] modified dockerfile --- Dockerfile | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index a872877..370439d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,6 @@ # use the official Bun image # see all versions at https://hub.docker.com/r/oven/bun/tags FROM oven/bun:1 AS base -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.lockb /temp/dev/ -RUN cd /temp/dev && bun install - -# install with --production (exclude devDependencies) -RUN mkdir -p /temp/prod -COPY package.json bun.lockb /temp/prod/ -RUN cd /temp/prod && bun install --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 . . - -# copy production dependencies and source code into 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 . # Run bun:migration:drop if DB_DROP is set RUN if [ "$DB_DROP" = "true" ]; then bun run migration:drop; fi @@ -40,6 +15,5 @@ RUN if [ "$DB_SEED" = "true" ]; then bun run migration:seed; fi RUN if [ "$DB_DROP" = "true" ]; then bun run migration:drop; fi # run the app -USER bun EXPOSE 3000/tcp -ENTRYPOINT [ "bun", "run", "index.ts" ] \ No newline at end of file +CMD [ "bun", "dev" ]