-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (30 loc) · 1.15 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
# FROM node:14-buster-slim AS base
FROM node:14-buster as builder
WORKDIR /usr/src/
# Copy all the code that we need in order to build
COPY package.json package.json
COPY yarn.lock yarn.lock
COPY src src
COPY tsconfig.json tsconfig.json
COPY tslint.json tslint.json
COPY .eslintrc .eslintrc
# TODO Edit the list above to suit your needs
# Install all of the required dependencies, including dev dependencies, inside
# the builder container
RUN yarn install
# Run the build command to build into dist/
RUN yarn build
# ------------------------------------------------------------------------------
# From builder to production image
# ------------------------------------------------------------------------------
# Start over with a clean build
# NOTE: We start from the 14-buster-slim build here because we want the
# slimmest possible build for our final production container, but the slim
# container isn't sufficient to build all the node-gyp stuff.
FROM node:14-buster-slim
WORKDIR /usr/src/
# We only need to copy the dist directory from the builder
COPY --from=builder /usr/src/dist/ ./dist/
# # Expose the port we use
# EXPOSE 14000
CMD [ "node", "dist/" ]