-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (23 loc) · 913 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
29
30
31
32
33
34
35
36
37
38
39
FROM node:lts-bullseye-slim AS development
RUN apt-get update && apt-get install -y procps openssl
WORKDIR /usr/src/app
COPY --chown=node:node package.json yarn.lock ./
RUN yarn agdb-install-dev
COPY --chown=node:node . .
USER node
FROM node:lts-bullseye-slim AS build
WORKDIR /usr/src/app
COPY --chown=node:node package.json yarn.lock ./
COPY --chown=node:node --from=development /usr/src/app/node_modules ./node_modules
COPY --chown=node:node . .
RUN yarn agdb-build
ENV NODE_ENV production
RUN yarn agdb-install-prod
USER node
FROM node:lts-bullseye-slim AS production
COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules
COPY --chown=node:node --from=build /usr/src/app/dist ./dist
COPY --chown=node:node --from=build /usr/src/app/scripts/*.sh ./scripts/
USER node
# TODO: Workaround for migrations, not ideal for production but it works
RUN yarn global add @nestjs/cli