Package breakdown - initial commit 1.0.0

This commit is contained in:
2023-05-23 14:28:43 -04:00
commit 929ebd96d6
33 changed files with 995 additions and 0 deletions

28
Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
ARG ENV=production
ARG MONGO_VERSION=latest
ARG PORT=9001
## mongo build stage
FROM mongo:$MONGO_VERSION AS database
COPY docker-entrypoint-initdb.d/mongo-init-$MONGO_VERSION.sh ./docker-entrypoint-initdb.d/mongo-init.sh
## stage one, build the service
FROM node:20-alpine AS build
ENV NODE_ENV development
WORKDIR /home/node/app
COPY package*.json ./
COPY tsconfig.json ./
COPY lib ./lib
RUN ls -a
RUN yarn install
RUN yarn build
## this is stage two , where the app actually runs
FROM node:20-alpine AS containerize
ENV NODE_ENV $ENV
WORKDIR /home/node/app
COPY package*.json ./
RUN yarn install --frozen-lockfile --production
COPY --from=build /home/node/app/dist .
EXPOSE $PORT
CMD ["node","server/index.js"]