forked from SAGE-Technology-Solutions/nestjs-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (23 loc) · 620 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (23 loc) · 620 Bytes
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
FROM node:16-alpine As development
RUN npm set progress=false && npm config set depth 0
WORKDIR /usr/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
RUN chmod +x -R scripts/
EXPOSE 6060
CMD [ "sh", "./scripts/dev.start.sh" ]
FROM node:16-alpine As release
RUN npm set progress=false && npm config set depth 0
ARG NODE_ENV=production
ENV NODE_ENV=production
WORKDIR /usr/app
COPY package*.json ./
RUN npm install --omit=dev
COPY *.json ./
COPY scripts/ ./scripts
RUN chmod +x -R scripts/
COPY --from=development /usr/app/dist ./dist
EXPOSE 6060
CMD [ "sh", "./scripts/prod.start.sh" ]