build(docker): switch to multistage build image
This commit is contained in:
parent
9d3505d299
commit
7d94c70adc
2 changed files with 19 additions and 8 deletions
|
|
@ -1,5 +1,20 @@
|
|||
ARG SITE=signpost.cloud.mareshq.com
|
||||
|
||||
FROM node:lts as builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY ./sites/${SITE}/package.json .
|
||||
|
||||
RUN yarn install --frozen-lockfile
|
||||
|
||||
COPY ./sites/${SITE} .
|
||||
|
||||
RUN yarn build
|
||||
|
||||
# Final image
|
||||
FROM nginx:mainline-alpine as nginx
|
||||
|
||||
COPY ./../../build/nginx/site.conf /etc/nginx/conf.d/default.conf
|
||||
COPY ./build/nginx/site.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY ./out /var/www/html
|
||||
COPY --from=builder /build/out /var/www/html
|
||||
|
|
|
|||
Reference in a new issue