-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (37 loc) · 947 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
47
48
49
50
51
52
53
54
55
# syntax=docker/dockerfile:1.12
FROM node:lts-alpine AS builder
WORKDIR /veritable-ui
# Install base dependencies
RUN npm install -g [email protected]
COPY package*.json ./
COPY tsconfig.json ./
RUN npm ci
COPY . .
RUN npm run build
# Test stage
FROM node:lts-bookworm-slim AS test
WORKDIR /veritable-ui
RUN npm install -g [email protected]
COPY package*.json ./
COPY tsconfig.json ./
RUN npm ci
COPY . .
RUN npm run build
ARG NODE_ENV=test
ENV NODE_ENV=${NODE_ENV}
RUN npx playwright install --with-deps
CMD ["npm", "run", "test:playwright"]
# Service
FROM node:lts-alpine AS service
WORKDIR /veritable-ui
RUN apk add --no-cache coreutils curl
RUN npm -g install [email protected]
COPY package*.json ./
RUN npm ci --omit=dev
COPY public ./public
COPY knexfile.js ./
COPY --from=builder /veritable-ui/build ./build
HEALTHCHECK --interval=30s --timeout=20s \
CMD curl -f http://localhost:3000/health || exit 1
EXPOSE 3000
CMD [ "npm", "start" ]