Added Ts.ED
This commit is contained in:
47
backend/Dockerfile
Normal file
47
backend/Dockerfile
Normal file
@@ -0,0 +1,47 @@
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
## _______ _____ ______ _____ ##
|
||||
## |__ __/ ____| ____| __ \ ##
|
||||
## | | | (___ | |__ | | | | ##
|
||||
## | | \___ \| __| | | | | ##
|
||||
## | | ____) | |____| |__| | ##
|
||||
## |_| |_____/|______|_____/ ##
|
||||
## ##
|
||||
## description : Dockerfile for TsED Application ##
|
||||
## author : TsED team ##
|
||||
## date : 2022-03-05 ##
|
||||
## version : 2.0 ##
|
||||
## ##
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
ARG NODE_VERSION=16.13.1
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine as build
|
||||
WORKDIR /opt
|
||||
|
||||
COPY package.json yarn.lock tsconfig.json tsconfig.compile.json .barrelsby.json ./
|
||||
|
||||
RUN yarn install --pure-lockfile
|
||||
|
||||
COPY ./src ./src
|
||||
|
||||
RUN yarn build
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine as runtime
|
||||
ENV WORKDIR /opt
|
||||
WORKDIR $WORKDIR
|
||||
|
||||
RUN apk update && apk add build-base git curl
|
||||
RUN npm install -g pm2
|
||||
|
||||
COPY --from=build /opt .
|
||||
|
||||
RUN yarn install --pure-lockfile --production
|
||||
COPY ./prisma ./prisma
|
||||
COPY processes.config.js .
|
||||
|
||||
EXPOSE 8081
|
||||
ENV PORT 8081
|
||||
ENV NODE_ENV production
|
||||
|
||||
CMD ["pm2-runtime", "start", "processes.config.js", "--env", "production"]
|
||||
Reference in New Issue
Block a user