diff --git a/Dockerfile b/Dockerfile index 3e930ea..8090bd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,14 @@ -FROM oven/bun:1 as install +FROM oven/bun:1 as base + +FROM base as install RUN mkdir -p /temp/prod -COPY . /temp/prod -RUN cd /temp/prod && bun install --production --frozen-lockfile && bun run build +COPY package.json bun.lockb /temp/prod/ +RUN cd /temp/prod && bun install --production --frozen-lockfile + +FROM base as build +RUN mkdir -p /temp/prod +COPY . /temp/prod/ +RUN cd /temp/prod && bun run build FROM nginx AS release -COPY --from=install /temp/prod/dist /usr/share/nginx/html \ No newline at end of file +COPY --from=build /temp/prod/dist /usr/share/nginx/html \ No newline at end of file diff --git a/bunfig.toml b/bunfig.toml index 54b7a49..5301d49 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,2 +1,7 @@ [test] -preload = './happydom.ts' \ No newline at end of file +preload = './happydom.ts' + +[install.lockfile] +# whether to save a non-Bun lockfile alongside bun.lockb +# only "yarn" is supported +print = "yarn"