From 0dff270e82c893d3be615af532008f4b73ba88d3 Mon Sep 17 00:00:00 2001 From: Brian McGonagill Date: Fri, 26 Jul 2024 09:33:25 -0500 Subject: [PATCH] Added new Dockerfile for docker builds --- .meteor/versions | 2 +- Dockerfile | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.meteor/versions b/.meteor/versions index 232eddd..6007c47 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -88,7 +88,7 @@ templating-tools@1.2.3 tracker@1.3.3 typescript@4.9.5 ui@1.0.13 -underscore@1.6.1 +underscore@1.6.2 url@1.3.2 webapp@1.13.8 webapp-hashing@1.1.1 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6cf4fd2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,48 @@ +FROM alpine:3.17 + +ENV NODE_VERSION=14.21.4 +ENV NODE_URL="https://static.meteor.com/dev-bundle-node-os/unofficial-builds/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" +ENV DIR_NODE=/usr/local + +RUN apk add --no-cache \ + libstdc++ \ + && apk add --no-cache --virtual .build-deps-full \ + bash \ + binutils-gold \ + curl \ + g++ \ + gcc \ + gnupg \ + libgcc \ + linux-headers \ + make \ + python3 \ + ccache \ + xz + +RUN echo $NODE_URL +RUN curl -sSL "$NODE_URL" | tar -xz -C /usr/local/ && mv $DIR_NODE/node-v${NODE_VERSION}-linux-x64 $DIR_NODE/v$NODE_VERSION + +# add node and npm to path so the commands are available +ENV NODE_PATH $DIR_NODE/v$NODE_VERSION/lib/node_modules +ENV PATH $DIR_NODE/v$NODE_VERSION/bin:$PATH + +# confirm installation +RUN node -v +RUN npm -v + +ENV MONGO_URL=mongodb://mongo:27017/get_my\ + ROOT_URL=http://localhost \ + PORT=3000 \ + MAIL_URL=smtp://USERNAME:PASSWORD@HOST:PORT + +RUN mkdir -p /usr/src/get_my +WORKDIR /usr/src/get_my +COPY bundle/ /usr/src/get_my/ + +RUN cd /usr/src/get_my/programs/server/ \ + && npm install + +EXPOSE 3000 + +CMD [ "node", "main.js" ]