imporve dockerfie form layer caching
This commit is contained in:
parent
210710fa3f
commit
c71111c646
15
Dockerfile
15
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
|
||||
COPY --from=build /temp/prod/dist /usr/share/nginx/html
|
|
@ -1,2 +1,7 @@
|
|||
[test]
|
||||
preload = './happydom.ts'
|
||||
preload = './happydom.ts'
|
||||
|
||||
[install.lockfile]
|
||||
# whether to save a non-Bun lockfile alongside bun.lockb
|
||||
# only "yarn" is supported
|
||||
print = "yarn"
|
||||
|
|
Loading…
Reference in New Issue