tubearchivist-frontend/Dockerfile

33 lines
644 B
Docker
Raw Normal View History

2022-10-18 19:28:37 +00:00
FROM node:16-bullseye-slim as deps
2021-09-05 17:10:14 +00:00
2022-10-18 19:28:37 +00:00
WORKDIR /myapp
2022-10-18 19:28:37 +00:00
ADD package.json yarn.lock .npmrc ./
RUN yarn install
2021-09-05 17:10:14 +00:00
2022-10-18 19:28:37 +00:00
# Build the app
FROM node:16-bullseye-slim as build
2021-09-05 17:10:14 +00:00
2022-10-18 19:28:37 +00:00
WORKDIR /myapp
2022-10-18 19:28:37 +00:00
COPY --from=deps /myapp/node_modules /myapp/node_modules
2022-10-18 19:28:37 +00:00
ADD . .
RUN yarn build
2022-10-18 19:28:37 +00:00
# Finally, build the production image with minimal footprint
FROM node:16-bullseye-slim
2022-10-18 19:28:37 +00:00
ENV PORT="8080"
ENV NODE_ENV="production"
2022-10-18 19:28:37 +00:00
WORKDIR /myapp
2022-10-18 19:28:37 +00:00
COPY --from=deps /myapp/node_modules /myapp/node_modules
2022-10-18 19:28:37 +00:00
COPY --from=build /myapp/build /myapp/build
COPY --from=build /myapp/public /myapp/public
COPY --from=build /myapp/package.json /myapp/package.json
2022-10-18 19:28:37 +00:00
ENTRYPOINT [ "yarn", "start" ]