-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (47 loc) · 1.56 KB
/
Dockerfile
File metadata and controls
59 lines (47 loc) · 1.56 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# ---- Base ----
FROM node:22-alpine AS base
WORKDIR /var/workspace
# ---- Dependencies (for production) ----
FROM base AS dependencies
COPY webapp/package*.json ./
RUN npm ci --only=production && npm cache clean --force
# ---- Dev Dependencies (for tests) ----
FROM base AS dev-dependencies
# Installs packages required for Puppeteer
RUN apk add --no-cache \
chromium \
freetype \
freetype-dev \
harfbuzz \
ca-certificates
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
COPY webapp .
RUN npm --silent install
# ---- Build ----
FROM base AS build
COPY webapp/package*.json ./
RUN npm i --only=production && npm cache clean --force
COPY webapp .
RUN npm run build
# ---- Test ----
FROM dev-dependencies AS test
CMD ["npm", "run", "test"]
# ---- Coverage ----
FROM dev-dependencies AS coverage
CMD ["npm", "run", "coverage"]
# ---- Production ----
FROM nginx:alpine AS production
COPY --from=build /var/workspace/build/client /usr/share/nginx/html
COPY docker/provisioning/nginx/conf.d/production.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
FROM nginx:1.27 AS reverse-proxy
COPY ./docker/provisioning/nginx/conf.d/default.conf /etc/nginx/conf.d
EXPOSE 8080
# ---- Vault ----
FROM hashicorp/vault:1.20
COPY ./docker/vault/vault.crt ./docker/vault/vault.key ./docker/vault/ca.crt /vault/config/
COPY ./docker/vault/central-system-client.crt /vault/config/central-system-client.crt
COPY ./docker/vault/vault-init.sh /usr/local/bin/vault-init.sh
RUN chmod +x /usr/local/bin/vault-init.sh