2022-06-15 17:42:15 -06:00
|
|
|
# XXX: Before updating this, make sure the issues around `npm` silently exiting
|
|
|
|
# with error 243 issues are solved:
|
|
|
|
# - https://github.com/npm/cli/issues/4996
|
|
|
|
# - https://github.com/npm/cli/issues/4769
|
|
|
|
FROM node:16.14.2-buster-slim
|
2022-06-15 01:28:18 -06:00
|
|
|
|
|
|
|
RUN mkdir -p /app
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2022-06-15 16:12:44 -06:00
|
|
|
# Copy the health-check script
|
|
|
|
COPY docker-health-check.js /app/
|
|
|
|
|
2022-06-15 01:28:18 -06:00
|
|
|
# Copy just what we need to install the dependencies so this layer can be cached
|
|
|
|
# in the Docker build
|
|
|
|
COPY package.json package-lock.json /app/
|
|
|
|
RUN npm install
|
|
|
|
|
|
|
|
# Copy what we need for the client-side build
|
2022-06-15 16:12:44 -06:00
|
|
|
COPY config /app/config/
|
2022-06-15 01:28:18 -06:00
|
|
|
COPY public /app/public/
|
|
|
|
COPY shared /app/shared/
|
|
|
|
COPY vite.config.js /app/
|
|
|
|
# Build the client-side bundle
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
# Copy the rest of the app
|
|
|
|
COPY server /app/server/
|
|
|
|
|
2022-06-15 16:12:44 -06:00
|
|
|
HEALTHCHECK CMD node docker-health-check.js
|
|
|
|
|
|
|
|
ENTRYPOINT ["/bin/bash", "-c", "npm start"]
|