build(frontend): streamline frontend deployment via Docker#149
build(frontend): streamline frontend deployment via Docker#149CammilleCC merged 16 commits intomainfrom
Conversation
8066f19 to
f78a8c9
Compare
| proxy_cache_bypass $http_upgrade; | ||
| } | ||
|
|
||
| # REMOVEME: Add URL with base path to allowed KeyCloak redirect URIs |
There was a problem hiding this comment.
There are two problems here:
-
Currently, the allowed redirect URLs on KeyCloak has a signature of
https://domain:port/oauth/callback. Unfortunately, KeyCloak don't support wildcard in the middlehttps://domain:port/*/oauth/callback, where*could be any base path. If we're sure that our base path isapp/, then we can ask ITDM to reflect this. -
I have added building the callback URI in this way, mainly due to the dev frontend using Traefik which supports both
httpandhttpsand making the API server a bit confused. It doesn't seem to be straightforward detecting the base path from the URL, maybe providing customX-forwarded-headerswould help.
As a workaround, I redirect /oauth/ from the KeyCloak redirect URI to /base_path/oauth. If you have any ideas on how to approach these, I would be happy to learn 😀
|
TBH I find the nginx configs confusing, although that's probably just because I don't understand nginx configs... Just to check, now we have two statically built sites, one The nginx configs are there to (with relative dirs relative to
Is that right? If so then using caddy instead of nginx the config would be something like this (assuming the static page builds are in # use cert files for tls
tls /app/certs/server.crt /app/certs/server.key
# revere proxy the api endpoints
@api path /app/oauth* /app/graphql* /app/metadata* /app/context*
reverse_proxy @api {$API_URL}
# serve app spa
handle_path /app* {
root * /app/app
try_files {path} /index.html
file_server
}
# serve site spa
handle {
root * /app/site
try_files {path} /index.html
file_server
}Either way as long as what's there now works we can think about this later. |
|
Thanks for the review 😊 I applied your suggestions now, I would appreciate a second look. You got my intentions for this PR. Seems like |
7b4e184 to
5e050d5
Compare
Co-authored-by: Robert Rosca <32569096+RobertRosca@users.noreply.github.com>
… for prod deployment
c090800 to
aee9b14
Compare
|
Merging this now as it works in production. |
This PR reorganises the frontend repo’s infra-related files to live at the repository root. The goal is to make it easier to run and reason about Docker compose workflows by standardising on the repo root as the working directory.
New structure:
Changes
compose.local.ymlapps/siteandapps/appcompose.dev.ymlapps/appcompose.test.ymlapps/siteat damnit-test.xfel.eu/apps/appat damnit-test.xfel.eu/app/All scripts and commands are intended to be executed from the repo root.
Usage
Examples (from repo root):
Local
Dev
Test
Testing