Conversation
|
This will work for production using only the |
766cc33 to
8642d14
Compare
|
I have added support for development and which the Dockerfile as is will support a base path. The only caveat is it changes angular.json in which could get caught up in a commit. |
8642d14 to
407f884
Compare
407f884 to
9a433b5
Compare
…-base-path-support
|
I can't seem to get this to work properly: e.g. with
|
|
@ybnd It appears not only does |
|
@WWelling and @ybnd : As the |
…-base-path-support
tdonohue
left a comment
There was a problem hiding this comment.
@WWelling : Thanks! Tested this and it works in Production mode, but it doesn't appear to fully work in Docker (it's possible I misunderstood your comments above on how to get it working in Docker).
- (WORKS) First, tested in production mode (running locally, not in Docker):
- Ran
yarn build:prod - Updated my local
config.prod.ymlto have:ui: ssl: false host: localhost port: 4000 nameSpace: /dspace - Started with:
yarn serve:ssr - SUCCESS. Everything is at http://localhost:4000/dspace Tested basic actions (search/browse/login/logout) and everything seems to work fine.
- Ran
- (DOESN'T WORK) Second, tested dev mode in Docker:
- NOTE: Already had backend/REST API running in Docker.
- Updated
./docker/docker-compose.ymlto change value ofDSPACE_UI_NAMESPACE.DSPACE_UI_NAMESPACE: /dspace - Spun up UI in Docker:
docker-compose -p d7 -f docker/docker-compose.yml up -d - Waited for it to build & boot
- INITIAL SUCCES: UI is available at http://localhost:4000/dspace
- FAILURE: Login doesn't work (redirects to
/dspace/dspace/home). Links in header don't work (Communities & Collections, All of DSpace, Statistics) -- same reason, uses/dspace/dspaceas the path. After login, all links in sidebar also use/dspace/dspace
Overall, I'm +1 this effort, but I wanted to note that it's not working in a Docker dev environment. It does work well for Production though. So, if needed, we could document this only works in Production for now.
|
@tdonohue thanks for testing. I am not sure what went wrong with testing Dockerfile (dev mode) as I had success. Possibly, If you want to test a clean full Docker deploy you can try, https://github.com/TAMULib/dspace-docker/tree/145-base-path-support. It is all ready to go for this branch. Caution: will clear docker images and containers
|
…-base-path-support
|
@tdonohue appears intermittent failing tests |
There was a problem hiding this comment.
👍 Thanks @WWelling ! Your guess was correct. I retested this today & everything works. I think my mistake last time was that I neglected to rebuild the dspace-angular Docker image (a very important step!) after applying this PR, so I had tried to test this with an outdated image.
After correctly rebuilding everything, I'm finding this works both for Docker (using DSPACE_UI_NAMESPACE env variable) and for normal production mode (using config.prod.yml). So, this looks good to me. Thanks!
…-base-path-support
artlowel
left a comment
There was a problem hiding this comment.
I just tried it today, and while it seems to work fine in dev mode, in prod mode it seems all the assets are still hosted under /
Perhaps I'm doing something wrong?
My prod config looks like this
ui:
nameSpace: /dspace7I also tried adding all the other UI properties but that doesn't make a difference
|
Thanks @artlowel. This is odd as we have it working in production on infrastructure, but it does not work with |
|
@artlowel could you please try again? |
|
Merging as this is now at +2. Thanks again @WWelling ! |
This bug was originally fixed in DSpace#1642 but reintroduced in DSpace#1805
|
Adding a late comment here hoping for some feedback on a related (I think) issue. I have just deployed a repo in a subdirectory here: |


References
Description
Provides base path support.
Instructions for Reviewers
Run dspace-angular with defining configuration
ui.nameSpacesuch as/dspace7. Which runs from URLhttp://localhost:4000/dspace7.List of changes in this PR:
yarn run lintpackage.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.