-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration-tests.Dockerfile
More file actions
39 lines (27 loc) · 1.01 KB
/
integration-tests.Dockerfile
File metadata and controls
39 lines (27 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
# Stage 1 — build
FROM node:22.1.0-alpine@sha256:487dc5d5122d578e13f2231aa4ac0f63068becd921099c4c677c850df93bede8 AS builder
ENV NODE_ENV=test \
TZ=UTC \
LANG=C.UTF-8
WORKDIR /usr/src/app
# native addons (e.g. keccak) require build tools
RUN apk add --no-cache python3 make g++ gcc linux-headers
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2 — test runner
FROM node:22.1.0-alpine@sha256:487dc5d5122d578e13f2231aa4ac0f63068becd921099c4c677c850df93bede8 AS runner
ENV NODE_ENV=test \
TZ=UTC \
LANG=C.UTF-8
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/bin ./bin
COPY --from=builder /usr/src/app/src ./src
COPY --from=builder /usr/src/app/package.json .
COPY --from=builder /usr/src/app/.mocharc.integ.js .
COPY --from=builder /usr/src/app/tsconfig.integ.json .
COPY --from=builder /usr/src/app/tsconfig.json .
CMD ["npm", "run", "test:integration"]