Add dockerfile and compose file for build
This commit is contained in:
21
Dockerfile
Normal file
21
Dockerfile
Normal 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
|
Reference in New Issue
Block a user