diff --git a/Dockerfile b/Dockerfile index fd67a537b..1a3a1508c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,34 +9,37 @@ RUN apt-get update && \ apt-get install -y curl python python3 make g++ bzip2 ca-certificates --no-install-recommends && \ rm -rf /var/lib/apt/lists/* +COPY ./types /home/app/src/types +COPY ./imports /home/app/src/imports +COPY ./server /home/app/src/server +COPY ./client /home/app/src/client +COPY ./.meteor /home/app/src/.meteor COPY [ \ - "./client", \ - "./imports", \ - "./server", \ - "./types", \ - "./.meteor", \ "./package.json", \ "./tsconfig.json", \ "./package-lock.json", \ - "/home/app/" \ + "/home/app/src/" \ ] RUN chown -R app:app /home/app/ USER app -RUN echo "export METEOR_LOCAL_RELEASE=$(sed -n 's/^METEOR@\([0-9][0-9]*.*\)$/\1/p' .meteor/release)" >> ./.env +RUN echo "export METEOR_LOCAL_RELEASE=$(sed -n 's/^METEOR@\([0-9][0-9]*.*\)$/\1/p' src/.meteor/release)" >> ./.env RUN . ./.env; echo "export METEOR_EXECUTABLE_VERSION=${METEOR_LOCAL_RELEASE}" >> ./.env RUN . ./.env; curl "https://install.meteor.com?release=${METEOR_EXECUTABLE_VERSION}" | sh -ARG PATH="/home/app/.meteor:${PATH}" +ENV PATH="/home/app/.meteor:${PATH}" RUN echo "export NODE_VERSION=$(meteor node --version | tail -c +2)" >> ./.env RUN echo "export NPM_VERSION=$(meteor npm --version)" >> ./.env +RUN find . -maxdepth 3 + # RUN meteor npm clean-install -RUN meteor npm run build -- ./dist --directory --architecture os.linux.x86_64 --server-only +RUN cd src && \ + meteor npm run build -- ../dist --directory --architecture os.linux.x86_64 --server-only RUN cd dist/bundle/programs/server && \ meteor npm install @@ -47,7 +50,7 @@ FROM $IMAGE_BASE RUN useradd --create-home --shell /bin/bash --uid 1000 --user-group app -COPY --from=build src/dist/bundle /home/app/ +COPY --from=build dist/bundle /home/app/ RUN chown -R app:app /home/app/ @@ -56,7 +59,7 @@ WORKDIR /home/app ENV \ ARCH="linux-x64" \ - NODE_INSTALL_PATH="/home/app/bin" + NODE_INSTALL_PATH="${HOME}/bin" RUN mkdir -p "${NODE_INSTALL_PATH}" && \ rm -r "${NODE_INSTALL_PATH}"