Skip to content

Commit

Permalink
Revert "simplify env stuff"
Browse files Browse the repository at this point in the history
This reverts commit 748733a.
  • Loading branch information
FelixTJDietrich committed Aug 13, 2024
1 parent 748733a commit 7192ef1
Show file tree
Hide file tree
Showing 9 changed files with 792 additions and 127 deletions.
1 change: 1 addition & 0 deletions webapp/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NG_APPLICATION_SERVER_URL=http://localhost:8080
11 changes: 0 additions & 11 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ 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: 12 additions & 6 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": "@angular-devkit/build-angular:application",
"builder": "@ngx-env/builder:application",
"options": {
"outputPath": "dist/webapp",
"index": "src/index.html",
Expand All @@ -56,7 +56,11 @@
"styles": [
"src/styles.css"
],
"scripts": []
"scripts": [],
"ngxEnv": {
"prefix": "NG_",
"root": "../../"
}
},
"configurations": {
"production": {
Expand All @@ -83,7 +87,7 @@
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@ngx-env/builder:dev-server",
"configurations": {
"production": {
"buildTarget": "webapp:build:production"
Expand All @@ -95,10 +99,10 @@
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
"builder": "@ngx-env/builder:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@ngx-env/builder:karma",
"options": {
"polyfills": [
"zone.js",
Expand All @@ -123,7 +127,9 @@
"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 7192ef1

Please sign in to comment.