-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (32 loc) · 871 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
35
36
37
38
39
40
41
42
43
44
45
46
# use node:lts-alpine
# build hangs for arm/v7 platform on alpine image
# https://github.com/nodejs/docker-node/issues/2077
# let's use slim for now
ARG BASE_IMAGE=node:20.14.0-alpine
FROM --platform=$BUILDPLATFORM ${BASE_IMAGE} AS builder
WORKDIR /app
COPY package.json \
package-lock.json \
./
RUN npm install
COPY tsconfig.json \
tsconfig.cjs.json \
jest.config.js \
.prettierrc.js \
.eslintrc.js \
.eslintignore \
./
COPY __tests__ __tests__/
COPY src src/
RUN npm run test:before-publish
FROM --platform=$BUILDPLATFORM ${BASE_IMAGE}
WORKDIR /app
COPY --from=builder /app/package.json \
/app/package-lock.json \
./
RUN NODE_ENV=production npm install
COPY --from=builder /app/dist dist/
RUN NODE_ENV=production npm install -g
USER nobody
WORKDIR /data
ENTRYPOINT [ "inwx-apply" ]