2023-09-11 12:33:16 +00:00
|
|
|
FROM node:lts as build
|
|
|
|
# Reduce npm log spam and colour during install within Docker
|
|
|
|
ENV NPM_CONFIG_LOGLEVEL=warn
|
|
|
|
ENV NPM_CONFIG_COLOR=false
|
2023-09-11 12:02:23 +00:00
|
|
|
|
2023-09-11 12:33:16 +00:00
|
|
|
WORKDIR /home/node/app
|
2023-09-11 12:02:23 +00:00
|
|
|
|
2023-09-11 12:33:16 +00:00
|
|
|
COPY --chown=node:node . /home/node/app/
|
2023-09-11 12:02:23 +00:00
|
|
|
|
2023-09-11 12:33:16 +00:00
|
|
|
RUN npm install
|
|
|
|
RUN npm run typecheck
|
|
|
|
RUN npm run build
|
2023-09-11 12:02:23 +00:00
|
|
|
|
|
|
|
FROM nginx:stable as production
|
2023-09-11 12:33:16 +00:00
|
|
|
WORKDIR /home/node/app
|
2023-09-11 12:02:23 +00:00
|
|
|
# Copy what we've installed/built from production
|
|
|
|
COPY --chown=nobody:nogroup --from=build /home/node/app/build /usr/share/nginx/html/
|
|
|
|
|