forked from GovStackWorkingGroup/bb-identity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 628 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 628 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
#use node 16 base image (see .nvmrc)
FROM node:16-alpine as ts-compiler
# Install build deps
WORKDIR /usr/app
COPY package.json ./
COPY yarn.lock ./
RUN yarn install
# Build app
COPY ./src ./src
COPY build.ts ./
COPY tsconfig*.json ./
RUN yarn build
# Copy ts compile and build dependencies
FROM node:16-alpine as ts-remover
WORKDIR /usr/app
COPY --from=ts-compiler /usr/app/package.json ./
COPY --from=ts-compiler /usr/app/yarn.lock ./
COPY --from=ts-compiler /usr/app/dist ./dist
# Install production deps
RUN yarn --production
ENV NODE_ENV production
USER 1000
# Expose the server
EXPOSE 8081
CMD [ "yarn", "start"]