-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from UST-QuAntiL/feature/load-envs-after-build
set environment variables dynamically add dockerignore
- Loading branch information
Showing
8 changed files
with
83 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dist | ||
node_modules | ||
docs | ||
.idea | ||
.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
FROM node:14.9.0-alpine | ||
|
||
FROM node:alpine AS builder | ||
RUN apk add --no-cache git gettext | ||
|
||
ENV ALTAS_URL localhost | ||
ENV ATLAS_PORT 8080 | ||
ENV PATTERNPEDIA_URL localhost | ||
ENV PATTERNPEDIA_PORT 8081 | ||
ENV NISQ_ANALYZER_URL localhost | ||
ENV QC_ATLAS_HOST_NAME localhost | ||
ENV QC_ATLAS_PORT 8080 | ||
ENV PATTERN_ATLAS_HOST_NAME localhost | ||
ENV PATTERN_ATLAS_PORT 8081 | ||
ENV NISQ_ANALYZER_HOST_NAME localhost | ||
ENV NISQ_ANALYZER_PORT 8082 | ||
ENV PATTERN_ATLAS_UI_URL localhost | ||
ENV PATTERN_ATLAS_UI_HOST_NAME localhost | ||
ENV PATTERN_ATLAS_UI_PORT 4201 | ||
ENV LATEX_RENDERER_HOST_NAME localhost | ||
ENV LATEX_RENDERER_PORT 8083 | ||
|
||
WORKDIR /usr/src/app | ||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
COPY . . | ||
|
||
RUN npm install -g @angular/cli @angular-devkit/build-angular && npm install | ||
RUN chmod +x docker-entrypoint.sh | ||
RUN npm install && npm run build --prod | ||
|
||
EXPOSE 4200 | ||
FROM nginx:alpine | ||
COPY --from=builder app/dist/* /usr/share/nginx/html | ||
|
||
CMD ["sh", "docker-entrypoint.sh"] | ||
# When the container starts, replace the env.js with values from environment variables | ||
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.js.template > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions | ||
(function (window) { | ||
window['env'] = window['env'] || {}; | ||
|
||
// Environment variables | ||
|
||
window['env']['production'] = false; | ||
window['env']['nisqAnalyzer'] = true; | ||
window['env']['QC_ATLAS_HOST_NAME'] = 'localhost'; | ||
window['env']['NISQ_ANALYZER_HOST_NAME'] = 'localhost'; | ||
window['env']['PATTERN_ATLAS_HOST_NAME'] = 'localhost'; | ||
window['env']['LATEX_RENDERER_HOST_NAME'] = 'localhost'; | ||
window['env']['QC_ATLAS_PORT'] = 8080; | ||
window['env']['NISQ_ANALYZER_PORT'] = 8081; | ||
window['env']['PATTERN_ATLAS_PORT'] = 8082; | ||
window['env']['LATEX_RENDERER_PORT'] = 8083; | ||
})(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions | ||
(function (window) { | ||
window['env'] = window['env'] || {}; | ||
|
||
// Environment variables | ||
window['env']['production'] = true; | ||
window['env']['nisqAnalyzer'] = "${NISQ_ANALYZER_HOST_NAME}" ? true : false; | ||
window['env']['QC_ATLAS_HOST_NAME'] = "${QC_ATLAS_HOST_NAME}"; | ||
window['env']['NISQ_ANALYZER_HOST_NAME'] = "${NISQ_ANALYZER_HOST_NAME}"; | ||
window['env']['PATTERN_ATLAS_HOST_NAME'] = "${PATTERN_ATLAS_HOST_NAME}"; | ||
window['env']['LATEX_RENDERER_HOST_NAME'] ="${LATEX_RENDERER_HOST_NAME}"; | ||
window['env']['QC_ATLAS_PORT'] = "${QC_ATLAS_PORT}"; | ||
window['env']['NISQ_ANALYZER_PORT'] = "${NISQ_ANALYZER_PORT}"; | ||
window['env']['PATTERN_ATLAS_PORT'] = "${PATTERN_ATLAS_PORT}"; | ||
window['env']['LATEX_RENDERER_PORT'] ="${LATEX_RENDERER_PORT}"; | ||
})(this); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters