Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add new build target for reverse proxy in devcontainer #840

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,41 @@
"optimization": false,
"extractLicenses": false,
"sourceMap": true
},
"devcontainer": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/app/config/constants/apiURL.ts",
"with": "src/app/config/constants/apiURL.devcontainer.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"buildTarget": "doubtfire:build"
"buildTarget": "doubtfire:build",
"port": 4200,
"host": "0.0.0.0"
},
"configurations": {
"development": {
"buildTarget": "doubtfire:build:development"
},
"production": {
"buildTarget": "doubtfire:build:production"
},
"docker": {
"buildTarget": "doubtfire:build:development"
},
"devcontainer": {
"buildTarget": "doubtfire:build:devcontainer",
"port": 4201,
"host": "localhost"
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions env.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ module.exports = {
docker: {
// API URL should use the DF_DOCKER_MACHINE_IP set
API_URL: 'http://' + process.env.DF_DOCKER_MACHINE_IP + ':3000/api'
},

devcontainer: {
// API URL should use the DF_DOCKER_MACHINE_IP set
API_URL: 'http://' + process.env.DF_DOCKER_MACHINE_IP + ':4200/api'
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "doubtfire",
"version": "8.0.0-4",
"homepage": "http://github.com/doubtfire-lms/",
"homepage": "https://github.com/doubtfire-lms/",
"description": "Learning and feedback tool.",
"license": "AGPL-3.0",
"repository": {},
Expand All @@ -14,7 +14,7 @@
"build:angular17": "ng build",
"lint:fix": "ng lint --fix",
"lint": "ng lint",
"serve:angular17": "export NODE_OPTIONS=--max_old_space_size=4096 && ng serve --host 0.0.0.0",
"serve:angular17": "export NODE_OPTIONS=--max_old_space_size=4096 && ng serve --configuration $NODE_ENV",
"start": "npm-run-all -l -s build:angular1 -p watch:angular1 serve:angular17",
"watch:angular1": "grunt delta",
"deploy:build2api": "ng build --delete-output-path=true --optimization=true --configuration production --output-path dist",
Expand Down
2 changes: 2 additions & 0 deletions src/app/config/constants/apiURL.devcontainer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const API_URL = `${window.location.origin}/api`;
export default API_URL;
Loading