Add dockerfile and compose file for build

This commit is contained in:
GooeyTuxedo
2023-04-05 19:22:51 -07:00
parent f48c36f9c3
commit 6edd6ec2cc
3 changed files with 32 additions and 1 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM node:18-slim as ts-compiler
WORKDIR /usr/app
COPY yarn.lock ./
COPY package*.json ./
COPY tsconfig*.json ./
RUN yarn install --frozen-lockfile
COPY . ./
RUN yarn run build
FROM node:18-slim as ts-remover
WORKDIR /usr/app
COPY --from=ts-compiler /usr/app/yarn.lock ./
COPY --from=ts-compiler /usr/app/package*.json ./
COPY --from=ts-compiler /usr/app/dist ./
ENV NODE_ENV=production
RUN yarn install --frozen-lockfile
FROM node:18-slim
WORKDIR /usr/app
COPY --from=ts-remover /usr/app ./
CMD node index.js