Skip to content

Commit

Permalink
🚧 progress: Attempt at debugging Dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Apr 2, 2024
1 parent 19015ae commit 844b1e5
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,67 +9,71 @@ 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

ENV \
ARCH="linux-x64" \
NODE_INSTALL_PATH="/home/app/bin"

RUN . ./.env; \
mkdir -p "${NODE_INSTALL_PATH}" && \
curl "https://static.meteor.com/dev-bundle-node-os/v${NODE_VERSION}/node-v${NODE_VERSION}-${ARCH}.tar.gz" | \
tar xzf - -C "${NODE_INSTALL_PATH}"



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 /home/app/dist/bundle /home/app/dist/
COPY --from=build /home/app/bin /home/app/bin/

RUN chown -R app:app /home/app/

USER app
WORKDIR /home/app

ENV \
ARCH="linux-x64" \
NODE_INSTALL_PATH="/home/app/bin"

RUN mkdir -p "${NODE_INSTALL_PATH}" && \
rm -r "${NODE_INSTALL_PATH}"

RUN . ./.env; \
curl "https://static.meteor.com/dev-bundle-node-os/v${NODE_VERSION}/node-v${NODE_VERSION}-${ARCH}.tar.gz" | \
tar xzf - -C "${NODE_INSTALL_PATH}"

ENV PATH="${NODE_INSTALL_PATH}:${PATH}"
ENV PATH="/home/app/bin:${PATH}"

EXPOSE 3000

ENV ROOT_URL=http://localhost
ENV PORT=${PORT:-3000}
ENV \
ROOT_URL=${ROOT_URL:-http://localhost} \
PORT=${PORT:-3000} \
MONGO_URL=${MONGO_URL:-mongodb://127.0.0.1:27017/meteor}

CMD ['node', 'main.js']
CMD ["node", "dist/main.js"]

0 comments on commit 844b1e5

Please sign in to comment.