diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..94143827ed065ca0d7d5be1b765d255c5c32cd9a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a7acc8669c82801687c4ed78b92f152c63fc4def --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +### THIS FILE IS A REPLICA FROM ORCHESTRATOR-CORE-GUI WITH SOME MINOR ADJUSTMENTS + +############################### +### BASE LAYER FOR IMAGES BELOW +FROM node:14.21.1-slim AS base + +ENV CI=true + +WORKDIR /app +COPY orchestrator-core-gui/package.json . +COPY orchestrator-core-gui/yarn.lock . + +########################################### +### BUILDER LAYER TO PREPARE FOR PRODUCTION +FROM base AS builder + +RUN apt update && apt install git -y +RUN yarn --network-concurrency 1 --frozen-lockfile +COPY orchestrator-core-gui/ . +RUN rm -rf src/custom +COPY custom src/custom +COPY logo.svg src/images/logo.svg +RUN yarn build + +######################## +### IMAGE FOR PRODUCTION +FROM nginx:alpine + +RUN apk update && apk add wget curl +COPY orchestrator-core-gui/default.conf /etc/nginx/conf.d/default.conf +COPY --from=builder /app/build /usr/share/nginx/html +COPY --from=builder /app/src/env.js.template . + +EXPOSE 8080 +CMD [ "/bin/ash", "-c", "envsubst < env.js.template > /usr/share/nginx/html/env.js && exec nginx -g 'daemon off;'"]