-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
28 lines (25 loc) · 939 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM node:lts-alpine AS dev_dependencies
WORKDIR /usr/src/buzzl/
COPY package.json yarn.* tsconfig.json ./
COPY ./src ./src
RUN yarn install --production=false --frozen-lockfile
FROM node:lts-alpine AS dependencies
WORKDIR /usr/src/buzzl/
COPY package.json yarn.* ./
COPY ./src ./src
RUN yarn install --production=true --frozen-lockfile
FROM node:lts-alpine AS build
WORKDIR /usr/src/buzzl/
COPY --from=dev_dependencies /usr/src/buzzl/ .
COPY . .
RUN yarn build
FROM node:lts-alpine AS runtime
USER node
ENV PATH /usr/src/buzzl/node_modules/.bin:$PATH
ENV NODE_ENV=production
COPY --chown=node:node --from=dependencies /app/node_modules /home/node/app/node_modules/
COPY --from=build --chown=node:node /app/dist /home/node/app/dist/
COPY --from=build --chown=node:node /app/scripts /home/node/app/scripts/
COPY --from=build --chown=node:node /app/prisma /home/node/app/prisma/
EXPOSE 7719
ENTRYPOINT yarn orm migration:run && npm start