-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (23 loc) · 731 Bytes
/
Dockerfile
File metadata and controls
35 lines (23 loc) · 731 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
# Start with fully-featured Node.js base image
FROM node:12 AS builder
WORKDIR /home/node/app
# Copy dependency information and install all dependencies
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Copy source code (and all other relevant files)
COPY src ./src
# Build code
COPY tsconfig.json tsconfig.build.json ./
RUN yarn build
# Run-time stage
FROM node:12-alpine
# Expose port 9000
EXPOSE 9000
WORKDIR /home/node/app
# Copy dependency information and install production-only dependencies
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --production
# Copy results from previous stage
RUN mkdir build
COPY --from=builder /home/node/app/build ./build
CMD [ "yarn", "start" ]