diff --git a/.dockerignore b/.dockerignore index 076e4b3..e15713b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ * +!.babelrc !*.json !*.html !*.js @@ -15,6 +16,8 @@ !scripts !Dockerfile !entrypoint.sh +node_modules +frontend/bower_modules client/node_modules server/node_modules diff --git a/Dockerfile b/Dockerfile index 88a03a4..98bc45f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,20 +19,34 @@ RUN npm install --global npm@latest FROM base AS production +RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \ + git + WORKDIR /website -COPY /*.html /*.js /*.json /website/ -RUN npm install && npm run build +COPY /*.json /website/ +RUN npm upgrade && npm install +COPY /.babelrc /*.html /*.js /website/ +COPY /src /website/src +COPY /frontend /website/frontend +RUN npm run build +RUN ls -altr /website WORKDIR /website/client -RUN mv ../node_modules . -COPY /client/*.js /client/*.json /client/public /client/src /website/client/ -RUN npm install && npm run build +COPY /client/*.json /website/client/ +RUN npm upgrade && npm install +COPY /client/*.js /website/client/ +COPY /client/public /website/client/public +COPY /client/src /website/client/src +RUN npm run build +RUN ls -altr /website/client -FROM production AS runtime1 +RUN echo $DEVELOPMENT + +FROM base AS runtime1 ONBUILD COPY --from=production /website/dist /website/dist ONBUILD COPY --from=production /website/*.html /website/ ONBUILD COPY --from=production /website/client/*.html /website/client/ -ONBUILD COPY --from=production /website/client/dist/ /website/client/dist/ +ONBUILD COPY --from=production /website/client/dist /website/client/dist FROM base AS runtime