forked from zws-im/zws
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (35 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
44 lines (35 loc) · 1.01 KB
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
FROM node:16.13.1-alpine3.13
WORKDIR /usr/src/app
ENV PORT=3000
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD curl -X GET --fail http://localhost:3000/health || exit 1
# hadolint ignore=DL3018
RUN apk add --no-cache \
# Needed for healthchecks
curl \
# Needed to use Google Cloud Profiler
ca-certificates \
# Needed to use compile Prisma on arm64
openssl libc6-compat \
# Needed to compile pprof
python3 make g++
# Install all dependencies
COPY prisma ./prisma
COPY package.json yarn.lock .yarnrc.yml turbo.json ./
COPY .yarn ./.yarn
COPY packages ./packages
COPY apps ./apps
# hadolint ignore=DL3060
RUN yarn install --immutable \
&& yarn prisma generate \
# Remove these since they are only needed to compile dependencies
&& apk del openssl libc6-compat python3 make g++
# Compile
RUN yarn build \
# Delete source files
&& yarn clean \
# Remove dev dependencies
&& yarn workspaces focus --all --production \
# Clean cache
&& yarn cache clean
CMD ["yarn", "start"]