-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add landingpage service Add config Add README Add documentation to main README Add landingpage to main compose.yaml includes * Allow landingpage to use https terminated URLs Update README with HTTPS changes Use newer image and fix config * Add landingpage DEV config Add DEV instructions to landingpage README Use newer image and fix config --------- Co-authored-by: Regina Hinzmann <regina.hinzmann@desy.de>
- Loading branch information
1 parent
686d0d6
commit a275873
Showing
10 changed files
with
107 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../.empty.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# [Landingpage](https://github.com/SciCatProject/LandingPageServer) | ||
|
||
The SciCat provides standardised search on published datasets via this LandingPageServer | ||
|
||
## Configuration options | ||
|
||
The landingpage configuration is set by the [config files](./config/). Files inside the [config](./config/) folder, with a `.json` extension are merged respecting the alphabetical order of the files in the **container**. | ||
|
||
:warning: Please note that [merging the config files](./entrypoints/merge_json.sh) is a functionality provided by `SciCat Live` and is not supported natively by the `landingpage`. | ||
|
||
## Default configuration | ||
|
||
In the default configuration [config.json file](./config/config.json), the landingpage is set to call the `backend service` available at `backend.localhost` (either [v4](../backend/services/v4/), by default, or [v3](../backend/services/v3/) if specified otherwise by setting `BE_VERSION`) and use the `localhost` frontend to redirect to the datasets details from the published data detail page. | ||
|
||
For an explanation of how setting `BE_VERSION` changes the environment creation see [here](../../README.md#docker-compose-profiles-and-env-variables-configuration-options). | ||
|
||
## Enable additional features | ||
|
||
Setting the [BACKEND_HTTPS_URL and FRONTEND_HTTPS_URL env variables](../../.env) requires changing the `backend` and the `frontend` URL used by the `landingpage`. This is managed [here](./entrypoints/merge_json.sh). | ||
|
||
:warning: When setting `LANDINGPAGE_HTTPS_URL` it is likely you also want to set the `BACKEND_HTTPS_URL` and `FRONTEND_HTTPS_URL`, to allow the communication between the two wherever the browser is accessed. | ||
|
||
With `DEV=true`, please use `npm start -- --host 0.0.0.0`. This is to allow traffic from any IP to the `landingpage` component and it is necessary since the component runs in the docker network. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
services: | ||
landingpage: | ||
image: ghcr.io/scicatproject/landingpageserver:v3.3 | ||
volumes: | ||
- ./config/config.json:/config/0.json | ||
# docker-entrypoint.d is available only in the nginx layer | ||
# so it is neglected in DEV | ||
- ./entrypoints/merge_json.sh:/docker-entrypoint.d/0.sh | ||
profiles: | ||
- search | ||
restart: on-failure | ||
depends_on: | ||
backend: | ||
condition: service_healthy | ||
environment: | ||
BACKEND_URL: ${BACKEND_HTTPS_URL:-http://backend.localhost} | ||
FRONTEND_URL: ${FRONTEND_HTTPS_URL:-http://localhost} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
services: | ||
landingpage: | ||
image: !reset null | ||
build: | ||
context: https://github.com/SciCatProject/LandingPageServer.git | ||
target: builder | ||
environment: | ||
CONFIG_DIR: /home/node/app/src/assets | ||
GITHUB_REPO: https://github.com/SciCatProject/LandingPageServer.git | ||
CHROME_BIN: /usr/bin/chromium | ||
volumes: | ||
- landingpage_dev:/home/node/app | ||
- ${PWD}/entrypoints/loop_entrypoints.sh:/usr/local/bin/loop_entrypoints.sh | ||
- ${PWD}/entrypoints/infinite_loop.sh:/usr/local/bin/infinite_loop.sh | ||
- ${PWD}/entrypoints/setup_git.sh:/docker-entrypoints/0.sh | ||
- ./entrypoints/merge_json.sh:/docker-entrypoints/1.sh | ||
- ./entrypoints/tests.sh:/docker-entrypoints/2.sh | ||
entrypoint: loop_entrypoints.sh | ||
command: infinite_loop.sh | ||
labels: | ||
- traefik.http.services.landingpage.loadbalancer.server.port=4200 | ||
healthcheck: | ||
test: pgrep -f "/bin/sh /usr/local/bin/infinite_loop.sh" | ||
retries: 5 | ||
user: root | ||
|
||
volumes: | ||
landingpage_dev: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include: | ||
- path: | ||
- compose.base.yaml | ||
- .${DEV:+/}compose.dev.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"directMongoAccess": true, | ||
"doiBaseUrl": "http://landingpage.localhost/detail/", | ||
"facility": "facility", | ||
"scicatBaseUrl": "${FRONTEND_URL}", | ||
"lbBaseUrl": "${BACKEND_URL}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
apk update && apk add jq gettext | ||
|
||
jq -s 'reduce .[] as $item ({}; . * $item)' /config/*.json | envsubst \ | ||
> "${CONFIG_DIR:-/usr/share/nginx/html/assets}"/config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
apk update && apk add chromium | ||
|
||
npm run test |