forked from y-kkamil/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (29 loc) · 1.03 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
# This Dockerfile must be execute with higher context, because firstly we have to create react components lib with local changes.
# If you want to build image without local changes of react components, delete 20 line of code.
FROM node:10.11.0-alpine as ui-generator
WORKDIR /app
# Install global dependencies
RUN apk update && apk upgrade && \
apk add --no-cache curl
# Install app dependencies
COPY package.json package-lock.json config-overrides.js /app/
RUN npm install --no-optional
# Copy sources
COPY src /app/src
COPY public /app/public
# Copy local changes from react-components package
COPY react-components/index.js /app/node_modules/@kyma-project/react-components/lib/index.js
# Download manifest
RUN npm run prepare
# Set env variables
ENV PRODUCTION true
# Test & Build
ENV CI true
RUN npm test
RUN npm run build
FROM nginx:1.14.0-alpine
LABEL source git@github.com:kyma-project/console.git
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=ui-generator /app/build var/public
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]