forked from OhMyGuus/BetterCrewLink-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (31 loc) · 998 Bytes
/
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
#################################################
# Common base image
#################################################
FROM node:14-alpine as common
RUN mkdir /app && chown node:node /app
WORKDIR /app
USER node
# Cache node_modules installation as they change
# less than code over time.
COPY package.json yarn.lock tsconfig.json ./
RUN yarn install --production && \
rm -rf ~/.cache /tmp/v8-compile-cache-1000
#################################################
# Compile stage
#################################################
FROM common as build
RUN yarn install
COPY src/ src/
RUN yarn compile
#################################################
# Production stage
#################################################
FROM common
COPY views/ views/
# It's a toss up on which order offsets and src
# should be. Offsets are gauranteed to change
# over time, but src has more changes in `git log`.
COPY public/ public/
COPY --from=build /app/dist/ dist
EXPOSE 9736
CMD ["node", "dist/index.js"]