0
1
lletieu
The code starts an app on a node instance running Alpine 3.13 with a production environment set. First, it installs git, openssh, and npm. Next, it copies the app's package.json, yarn.lock, and ./ files to the root of the instance and sets the environment variables NODE_ENV and WORKDIR toProduction. Finally, it builds the app using yarn.
FROM node:14-alpine3.13
WORKDIR /app
ENV NODE_ENV=production
RUN apk add --no-cache git openssh
RUN npm install -g @nestjs/cli
COPY ["package.json", "yarn.lock", "./"]
RUN yarn install --frozen-lockfile
COPY . .
RUN cp .env.production .env
RUN yarn build
EXPOSE 3000
CMD ["yarn", "start:prod"]