From 6eb58e0555cf48bd71756a18f67e27d50baf7876 Mon Sep 17 00:00:00 2001 From: Yujith Isura Date: Thu, 27 Feb 2020 14:30:11 +0530 Subject: [PATCH] docker file added for taining env --- client/Training.Dockerfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 client/Training.Dockerfile diff --git a/client/Training.Dockerfile b/client/Training.Dockerfile new file mode 100644 index 00000000..5b056154 --- /dev/null +++ b/client/Training.Dockerfile @@ -0,0 +1,26 @@ +FROM tiangolo/node-frontend:10 as builder + +ADD ./src /app/src +COPY package*.json /app/ +COPY ./public /app/public +WORKDIR /app +RUN npm ci +ENV REACT_APP_API_BASE_URL=https://apim-gw.training.elections.gov.lk/nominations/0.9 +# ENV REACT_APP_PDF_GENARATION_SERVICE_URL=http://pdf-service-z1jkglv.pxe-dev-platformer-1552477983757-1pdna.svc +ENV REACT_APP_PDF_GENARATION_SERVICE_URL=https://pdf.ecstag.opensource.lk +ENV REACT_APP_AUTH_BASE_URL=https://nominations.training.elections.gov.lk +ENV REACT_APP_NOMINATION_URL=https://nominations.training.elections.gov.lk + +RUN npm run build + +FROM nginx:1.15 + +COPY --from=builder /app/build/ /usr/share/nginx/html +COPY --from=builder /nginx.conf /etc/nginx/conf.d/default.conf +WORKDIR /usr/share/nginx/html/ + +EXPOSE 80 +CMD echo 'window._env_ = {}; window._env_.API_BASE ="'http://localhost:3000'"' > env-config.js && nginx -g 'daemon off;' +# CMD ["bash", "-c", "echo 'window._env_.API_BASE = \"$API_BASE\"' > env-config.js && nginx -g 'daemon off;'"] +# CMD echo ${API_BASE} +