Last active
August 19, 2022 20:07
-
-
Save linkdd/2a19e51f6158e53e89ff525544ac3f04 to your computer and use it in GitHub Desktop.
Revisions
-
linkdd revised this gist
Aug 19, 2022 . No changes.There are no files selected for viewing
-
linkdd created this gist
May 12, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,62 @@ # Tooling configuration files FROM scratch AS context ADD package.json \ yarn.lock \ .eslintrc.js \ .eslintignore \ /workspace/ # Source code FROM scratch AS sources ADD src /workspace/src # Install dependencies FROM node:alpine AS dependencies COPY --from=context /workspace/package.json /workspace/package.json COPY --from=context /workspace/yarn.lock /workspace/yarn.lock WORKDIR /workspace RUN yarn install --network-timeout 300000 --production # Install dev dependencies FROM node:alpine AS dev-dependencies COPY --from=dependencies /workspace /workspace WORKDIR /workspace RUN yarn install --network-timeout 300000 # Lint FROM node:alpine AS linter COPY --from=context /workspace /workspace COPY --from=dev-dependencies /workspace/node_modules /workspace/node_modules COPY --from=sources /workspace/src /workspace/src WORKDIR /workspace RUN yarn run lint # Build FROM node:alpine AS builder COPY --from=context /workspace /workspace COPY --from=dev-dependencies /workspace/node_modules /workspace/node_modules COPY --from=sources /workspace/src /workspace/src WORKDIR /workspace RUN yarn run build # Final artifact FROM nginx:alpine AS runner COPY --from=builder /workspace/dist/spa /usr/share/nginx/html WORKDIR /workspace ADD entrypoint.sh /workspace/entrypoint.sh EXPOSE 8000 CMD ["/bin/sh", "/workspace/entrypoint.sh"]