Fineract backend settings with environment variables

This commit is contained in:
Jose Alberto Hernandez
2022-07-13 16:40:23 +02:00
committed by Arnold Gálovics
parent 1b72136411
commit 14ceb4f3fd
44 changed files with 815 additions and 291 deletions
+18 -7
View File
@@ -1,23 +1,34 @@
###############
### STAGE 1: Build app
###############
FROM node:16-alpine as builder
RUN apk add --no-cache git
WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH
COPY package.json /usr/src/app/package.json
COPY ./ /usr/src/app/
RUN npm cache clear --force
RUN npm config set fetch-retry-maxtimeout 120000
RUN npm install --location=global @angular/cli@12.2.17
RUN npm install
COPY . .
RUN ng build --configuration production --output-path=/dist
RUN ng build --configuration production
###############
### STAGE 2: Serve app with nginx ###
###############
FROM nginx:alpine
FROM nginx:1.19.3
COPY --from=builder /usr/src/app/dist/web-app /usr/share/nginx/html
COPY --from=builder /dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# When the container starts, replace the env.js with values from environment variables
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"]