This repository has been archived on 2023-05-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
auth/Dockerfile
mifi f7f6dcae12
Some checks failed
continuous-integration/drone/push Build is failing
Goodbye warnings?
2023-05-11 22:50:41 -04:00

32 lines
731 B
Docker

ARG ENV=production
ARG MONGO_VERSION=latest
ARG PORT=9001
## mongo build stage
FROM mongo:$MONGO_VERSION AS database
RUN apk update && apk add git
WORKDIR /
COPY mongo-init.js ./docker-entrypoint-initdb.d/
## stage one, build the service
FROM node:20-alpine AS build
RUN apk update && apk add git
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"]