-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
47 lines (36 loc) · 1.02 KB
/
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
40
41
42
43
44
45
46
47
# Dockerfile
#
# -------------------------------------
# Context: Build Context
FROM node:lts-alpine as build
# Tini Entrypoint for Alpine
RUN apk add nmap
RUN apk add --no-cache tini
ENTRYPOINT [ "/sbin/tini", "--"]
# Set Working Directory Context
WORKDIR "/osteppy"
# Copy package files
COPY package.json .
COPY package-lock.json .
# Context: Dependencies
FROM build AS dependencies
# Install Modules
RUN npm install
# -------------------------------------
# Context: Builder
FROM dependencies as builder
# Copy necessary files to build osteppy
COPY src src
COPY tsconfig.build.json .
COPY tsconfig.json .
COPY nest-cli.json .
RUN npm run build
# -------------------------------------
# Context: Release
FROM build AS release
# GET deployment code from previous containers
COPY --from=dependencies /osteppy/node_modules /osteppy/node_modules
COPY --from=builder /osteppy/dist /osteppy/dist
COPY config_files /osteppy/config_files
# Running osteppy when the image gets built using a script
CMD ["sh", "-c", "npm run start:prod"]