2022-04-22 12:45:44 +00:00
|
|
|
# builder stage - use debian base image to avoid needing to install missing packages
|
|
|
|
FROM node:16.14.2-bullseye as builder
|
2021-03-23 12:07:19 +00:00
|
|
|
|
|
|
|
WORKDIR /usr/app
|
|
|
|
|
2022-04-22 12:45:44 +00:00
|
|
|
# disable gatsby telemetry and installing cypress binary
|
|
|
|
ENV GATSBY_TELEMETRY_DISABLED 1
|
|
|
|
ENV CYPRESS_INSTALL_BINARY 0
|
|
|
|
|
2022-04-07 12:51:12 +00:00
|
|
|
COPY packages/website/package.json \
|
|
|
|
packages/website/yarn.lock \
|
|
|
|
./
|
2021-07-26 17:06:15 +00:00
|
|
|
RUN yarn --frozen-lockfile
|
2021-03-23 12:07:19 +00:00
|
|
|
|
2022-04-07 12:12:24 +00:00
|
|
|
COPY packages/website/data ./data
|
|
|
|
COPY packages/website/src ./src
|
|
|
|
COPY packages/website/static ./static
|
2022-04-07 12:51:12 +00:00
|
|
|
COPY packages/website/gatsby-*.js \
|
2022-04-07 12:12:24 +00:00
|
|
|
packages/website/postcss.config.js \
|
|
|
|
packages/website/tailwind.config.js \
|
|
|
|
./
|
2021-03-23 12:07:19 +00:00
|
|
|
|
2021-07-26 11:28:27 +00:00
|
|
|
RUN yarn build
|
2021-04-01 12:04:20 +00:00
|
|
|
|
2022-04-22 12:45:44 +00:00
|
|
|
# main stage - use alpine base image to minimise the resulting image footprint
|
|
|
|
FROM node:16.14.2-alpine
|
|
|
|
|
|
|
|
WORKDIR /usr/app
|
|
|
|
|
|
|
|
# install http server for serving website files
|
|
|
|
RUN npm install --global http-server@14.1.0
|
|
|
|
|
|
|
|
COPY --from=builder /usr/app/public /usr/app/public
|
|
|
|
|
2021-04-01 12:04:20 +00:00
|
|
|
EXPOSE 9000
|
|
|
|
|
2022-04-22 12:49:05 +00:00
|
|
|
CMD ["http-server", "/usr/app/public", "-s -p 9000"]
|