Skip to content

Commit

Permalink
simplify env stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixTJDietrich committed Aug 13, 2024
1 parent 168a10f commit 748733a
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 793 deletions.
1 change: 0 additions & 1 deletion webapp/.env.development

This file was deleted.

11 changes: 11 additions & 0 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ WORKDIR /app

COPY ./ /app/

# Define the build argument
ARG APPLICATION_SERVER_URL

# Debugging step: Print all environment variables to see if APPLICATION_SERVER_URL is set
RUN printenv

# Replace the serverUrl in the environment.ts file with the value of APPLICATION_SERVER_URL
RUN echo "Replacing serverUrl in environment.ts with: ${APPLICATION_SERVER_URL}" && \
sed -i "s|serverUrl: '[^']*'|serverUrl: '${APPLICATION_SERVER_URL}'|g" src/environments/environment.ts && \
cat src/environments/environment.ts

RUN npm install
RUN npm run build

Expand Down
18 changes: 6 additions & 12 deletions webapp/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@ngx-env/builder:application",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/webapp",
"index": "src/index.html",
Expand All @@ -56,11 +56,7 @@
"styles": [
"src/styles.css"
],
"scripts": [],
"ngxEnv": {
"prefix": "NG_",
"root": "../../"
}
"scripts": []
},
"configurations": {
"production": {
Expand All @@ -87,7 +83,7 @@
"defaultConfiguration": "production"
},
"serve": {
"builder": "@ngx-env/builder:dev-server",
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "webapp:build:production"
Expand All @@ -99,10 +95,10 @@
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@ngx-env/builder:extract-i18n"
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@ngx-env/builder:karma",
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
Expand All @@ -127,9 +123,7 @@
"options": {
"configDir": ".storybook",
"browserTarget": "webapp:build",
"styles": [
"src/styles.css"
],
"styles": ["src/styles.css"],
"compodoc": false,
"port": 6006
}
Expand Down
Loading

0 comments on commit 748733a

Please sign in to comment.