-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev.Dockerfile
45 lines (31 loc) · 1.29 KB
/
dev.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
42
43
44
45
FROM --platform="linux/arm64" arm64v8/node@sha256:56e8282f4392fb96c877babc93b3829e46b79c6fbcd48c92de578febffc80587 AS builder
WORKDIR /app
COPY .yarn ./.yarn
COPY .yarnrc.yml ./
RUN [ "yarn", "set", "version", "1.22.17" ]
COPY /src ./src
COPY package.json yarn.lock ./
RUN yarn install
RUN yarn build
# 'yarn install --production' does not prune test packages which are necessary
# to build the app. So delete nod_modules and reinstall only production packages.
RUN [ "rm", "-rf", "node_modules" ]
RUN yarn install --production --frozen-lockfile
FROM --platform="linux/arm64" arm64v8/node@sha256:56e8282f4392fb96c877babc93b3829e46b79c6fbcd48c92de578febffc80587 AS final
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "tini"]
RUN [ "yarn", "set", "version", "1.22.17" ]
WORKDIR /app
# Copy in compile assets and deps from build container
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/src ./src
COPY --from=builder /app/package.json ./
COPY --from=builder /app/yarn.lock ./
# Add in dynatrace layer
COPY --from=khw46367.live.dynatrace.com/linux/oneagent-codemodules-musl:nodejs / /
ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so
ENV PORT 8080
EXPOSE $PORT
ENTRYPOINT ["tini", "--"]
CMD ["yarn", "start"]