forked from kyma-project/busola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (47 loc) · 1.8 KB
/
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
56
57
58
59
60
61
62
63
64
65
66
67
# this is a Dockerfile for single deployment app - both backend and frontends
# ---- Base Alpine with Node ----
FROM node:20.17-alpine3.20 AS builder
ARG default_tag
RUN apk update && \
apk upgrade && \
apk add --no-cache make yq
WORKDIR /app
# Install global dependencies
# Set env variables
ENV PRODUCTION true
ENV CI true
COPY . /app
RUN yq -i '.version = "'${default_tag}'"' public/version.yaml && \
make resolve validate
RUN npm run build:docker
RUN cd /app/backend && npm run build
# ---- Environments Configuration ----
FROM node:20.17-alpine3.20 AS configuration
WORKDIR /kyma
RUN apk add make
#Copy /kyma configuration into container to /kyma
COPY /kyma /kyma
RUN npm ci
RUN make prepare-configuration
# ---- Serve ----
FROM alpine:3.20.2
WORKDIR /app
RUN apk --no-cache upgrade && \
apk --no-cache --update add nginx nodejs npm yq
WORKDIR /app
COPY --chown=65532:65532 --from=builder /app/build /app/core-ui
COPY --chown=65532:65532 --from=builder /app/backend/backend-production.js /app/backend-production.js
COPY --chown=65532:65532 --from=builder /app/backend/certs.pem /app/certs.pem
COPY --chown=65532:65532 --from=builder /app/backend/package* /app/
COPY --chown=65532:65532 --from=builder /app/backend/settings/* /app/settings/
COPY --chown=65532:65532 --from=builder /app/start_node.sh /app/start_node.sh
COPY --chown=65532:65532 --from=configuration /kyma/build /app/core-ui/environments
RUN npm ci --only=production
# use sessionStorage as default
# SHOW_KYMA_VERSION for production
RUN yq eval -i '.config.features.SHOW_KYMA_VERSION.isEnabled = true' core-ui/defaultConfig.yaml
RUN yq eval -i '.config.defaultStorage = "sessionStorage"' core-ui/defaultConfig.yaml
USER 65532:65532
EXPOSE 3001
ENV NODE_ENV=production ADDRESS=0.0.0.0 IS_DOCKER=true ENVIRONMENT=""
ENTRYPOINT ["/app/start_node.sh"]