imporve dockerfie form layer caching

This commit is contained in:
Alie 2024-04-20 14:08:03 +02:00
parent 210710fa3f
commit c71111c646
2 changed files with 17 additions and 5 deletions

View File

@ -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
COPY --from=build /temp/prod/dist /usr/share/nginx/html

View File

@ -1,2 +1,7 @@
[test]
preload = './happydom.ts'
[install.lockfile]
# whether to save a non-Bun lockfile alongside bun.lockb
# only "yarn" is supported
print = "yarn"