tubearchivist-frontend/Dockerfile
Sean Norwood 2e213376e3
Initial
2022-10-18 14:28:37 -05:00

33 lines
644 B
Docker

FROM node:16-bullseye-slim as deps
WORKDIR /myapp
ADD package.json yarn.lock .npmrc ./
RUN yarn install
# Build the app
FROM node:16-bullseye-slim as build
WORKDIR /myapp
COPY --from=deps /myapp/node_modules /myapp/node_modules
ADD . .
RUN yarn build
# Finally, build the production image with minimal footprint
FROM node:16-bullseye-slim
ENV PORT="8080"
ENV NODE_ENV="production"
WORKDIR /myapp
COPY --from=deps /myapp/node_modules /myapp/node_modules
COPY --from=build /myapp/build /myapp/build
COPY --from=build /myapp/public /myapp/public
COPY --from=build /myapp/package.json /myapp/package.json
ENTRYPOINT [ "yarn", "start" ]