-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
36 lines (23 loc) · 990 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
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
FROM node:16.13-alpine AS build
WORKDIR /flowkit-ui
COPY package.json package.json
COPY . .
RUN apk add git
RUN yarn install \
&& yarn upgrade \
&& yarn build
FROM nginx:alpine
COPY container/nginx.conf /etc/nginx/conf.d/configfile.template
WORKDIR /usr/share/nginx/html
RUN rm -rf *
COPY --from=build /flowkit-ui/build .
ENV PORT 8080
ENV HOST 0.0.0.0
ENV PUBLIC_URL .
ENV REACT_APP_MAINTAINENCE_MODE ""
ENV GA_ID ""
EXPOSE 8080
# Substitute $PORT variable in config file with the one passed via "docker run"
CMD sh -c "envsubst '\$PORT' < /etc/nginx/conf.d/configfile.template > /etc/nginx/conf.d/default.conf && envsubst < env.js > env.js.tmp && mv env.js.tmp env.js && envsubst < index.html > index.html.tmp && mv index.html.tmp index.html && nginx -g 'daemon off;'"