Skip to content

Commit

Permalink
Add env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-pimenta-DME committed Feb 23, 2024
1 parent 6b9c112 commit 39b0a4f
Show file tree
Hide file tree
Showing 24 changed files with 1,043 additions and 330 deletions.
15 changes: 15 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
IDENTITY_URL="https://identity.keycloak.develop.eoepca.org"
REALM="master"
CLIENT_ID="eoepca-portal"
IDENTITY_API_URL="https://identity.api.develop.eoepca.org"
ADES_URL="https://ades.develop.eoepca.org/ogc-api/processes"
RESOURCE_CATALOGUE_URL="https://resource-catalogue.develop.eoepca.org"
DATA_ACCESS_URL="https://data-access.develop.eoepca.org"
WORKSPACE_URL="https://workspace-api.develop.eoepca.org"
WORKSPACE_DOCS_URL="https://workspace-api.develop.eoepca.org/docs#"
IMAGES_REGISTRY_URL="https://harbor.develop.eoepca.org"
DUMMY_SERVICE_URL="https://identity.dummy-service.develop.eoepca.org"
ACCESS_TOKEN_NAME="auth_user_id"
ACCESS_TOKEN_DOMAIN=".develop.eoepca.org"
REFRESH_TOKEN_NAME="auth_refresh_token"
REFRESH_TOKEN_DOMAIN=".develop.eoepca.org"
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ RUN npm i -g @angular/cli
RUN npm i

COPY . .
ARG CONFIGURATION=develop
RUN ng build --configuration=$CONFIGURATION
RUN ng build

### STAGE 2: Run ###
FROM nginx:stable-alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build /usr/src/app/dist/* /usr/share/nginx/html
COPY --from=build /usr/src/app/dist/* /usr/share/nginx/html
WORKDIR /start
COPY ./start.sh .
CMD [ "sh", "start.sh" ]
105 changes: 14 additions & 91 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@ngx-env/builder:browser",
"options": {
"outputPath": "dist/eoepca-portal",
"index": "src/index.html",
Expand All @@ -27,12 +27,16 @@
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
"src/assets",
"src/config"
],
"styles": [
"src/styles.scss"
],
"scripts": []
"scripts": [],
"ngxEnv": {
"prefix": "EOEPCA_"
}
},
"configurations": {
"production": {
Expand All @@ -48,76 +52,7 @@
"maximumError": "4kb"
}
],
"outputHashing": "all",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.production.ts"
}
]
},
"staging": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts"
}
]
},
"demo": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.demo.ts"
}
]
},
"develop": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.develop.ts"
}
]
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
Expand All @@ -127,35 +62,22 @@
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@ngx-env/builder:dev-server",
"configurations": {
"production": {
"browserTarget": "eoepca-portal:build:production"
},
"demo": {
"browserTarget": "eoepca-portal:build:demo"
},
"staging": {
"browserTarget": "eoepca-portal:build:staging"
},
"develop": {
"browserTarget": "eoepca-portal:build:develop"
}
},
"defaultConfiguration": "develop"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"builder": "@ngx-env/builder:extract-i18n",
"options": {
"browserTarget": "eoepca-portal:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@ngx-env/builder:karma",
"options": {
"polyfills": [
"zone.js",
Expand All @@ -165,7 +87,8 @@
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
"src/assets",
"src/config"
],
"styles": [
"@angular/material/prebuilt-themes/indigo-pink.css",
Expand Down
20 changes: 17 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@ services:
eoepca-portal:
build: .
container_name: eoepca-portal
environment:
- CONFIGURATION=develop
ports:
- '80:80'
- '80:80'
environment:
- IDENTITY_URL=${IDENTITY_URL}
- REALM=${REALM}
- CLIENT_ID=${CLIENT_ID}
- IDENTITY_API_URL=${IDENTITY_API_URL}
- ADES_URL=${ADES_URL}
- RESOURCE_CATALOGUE_URL=${RESOURCE_CATALOGUE_URL}
- DATA_ACCESS_URL=${DATA_ACCESS_URL}
- WORKSPACE_URL=${WORKSPACE_URL}
- WORKSPACE_DOCS_URL=${WORKSPACE_DOCS_URL}
- IMAGES_REGISTRY_URL=${IMAGES_REGISTRY_URL}
- DUMMY_SERVICE_URL=${DUMMY_SERVICE_URL}
- ACCESS_TOKEN_NAME=${ACCESS_TOKEN_NAME}
- ACCESS_TOKEN_DOMAIN=${ACCESS_TOKEN_DOMAIN}
- REFRESH_TOKEN_NAME=${REFRESH_TOKEN_NAME}
- REFRESH_TOKEN_DOMAIN=${REFRESH_TOKEN_DOMAIN}
Loading

0 comments on commit 39b0a4f

Please sign in to comment.