Skip to content

Commit

Permalink
Deployed 18e8338 to main with MkDocs 1.6.1 and mike 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ci-bot committed Nov 15, 2024
1 parent aee3b20 commit f5f1fdc
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 87 deletions.
58 changes: 48 additions & 10 deletions main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,39 @@ <h4 id="dev-configuration">
</a>
, as, after the docker services are running, one can attach to it and start developing using all VSCode features, including version control and debugging.
</p>
<p>
To ease writing DEV configuration, a dev template is provided
<a href="https://github.com/SciCatProject/scicatlive/blob/main/services/compose.dev.yaml">
here
</a>
and each component inhearits from it, as you can see
<a href="https://github.com/SciCatProject/scicatlive/blob/main/services/frontend/compose.dev.yaml">
here
</a>
setting the componenent specific variables from the relative
<a href="https://github.com/SciCatProject/scicatlive/blob/main/services/frontend/.env">
.env file
</a>
.
<img alt="" class="twemoji" src="https://cdn.jsdelivr.net/gh/jdecked/[email protected]/assets/svg/26a0.svg" title=":warning:"/>
Docker compose applies a
<a href="https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/#local-env-file-versus-project-directory-env-file">
precedence mechanism
</a>
whenever the same variable is defined in
<code>
.env
</code>
files in nested folders, with precedence to the folder where the default
<code>
COMPOSE_FILE
</code>
lives. This means that the current template cannot be used in case of nested components, at least for the parts where local variables are used. There is no conflict with variables defined multiple times in
<code>
.env
</code>
files at the same level.
</p>
<p>
<img alt="" class="twemoji" src="https://cdn.jsdelivr.net/gh/jdecked/[email protected]/assets/svg/26a0.svg" title=":warning:"/>
To prevent git unpushed changes from being lost when a container is restarted, the work folder of each service, when in DEV mode, is mounted to a docker volume, with naming convention
Expand All @@ -2052,18 +2085,23 @@ <h4 id="dev-configuration">
<a href="https://github.com/SciCatProject/scicatlive/blob/main/services/frontend/compose.dev.yaml">
GITHUB_REPO
</a>
including the branch using the same syntax and value as the build context).
</p>
<p>
e.g., for the frontend:
including the branch using the same syntax and value as the build context). You can achieve this, by setting the
<code>
GITHUB_REPO
</code>
env variable in the component
<code>
.env
</code>
file (e.g. the
<a href="https://github.com/SciCatProject/scicatlive/blob/main/services/frontend/.env">
frontend env file
</a>
) as follows:
</p>
<div class="highlight">
<pre><span></span><code><span class="w"> </span> build:
<span class="gd">- context: https://github.com/SciCatProject/frontend.git</span>
<span class="gi">+ context: https://github.com/SciCatProject/frontend.git#v4.4.1</span>
<span class="w"> </span> environment:
<span class="gd">- GITHUB_REPO: https://github.com/SciCatProject/frontend.git</span>
<span class="gi">+ GITHUB_REPO: https://github.com/SciCatProject/frontend.git#v4.4.1</span>
<pre><span></span><code><span class="gd">- GITHUB_REPO=https://github.com/SciCatProject/frontend.git</span>
<span class="gi">+ GITHUB_REPO=https://github.com/SciCatProject/frontend.git#v4.4.1</span>
</code></pre>
</div>
<p>
Expand Down
2 changes: 1 addition & 1 deletion main/search/search_index.json

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions main/services/backend/compose.dev.yaml

This file was deleted.

1 change: 0 additions & 1 deletion main/services/backend/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ include:
- services/${BE_VERSION:-v4}/compose.yaml
- .${LDAP_ENABLED:+/services/${BE_VERSION:-v4}/}compose.ldap.yaml
- .${OIDC_ENABLED:+/services/${BE_VERSION:-v4}/}compose.oidc.yaml
- .${DEV:+/}compose.dev.yaml
5 changes: 4 additions & 1 deletion main/services/backend/services/v3/compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
services:
backend:
extends:
file: ${PWD}/services/compose.dev.yaml
service: node-app-from-local
environment:
NODE_ENV: development
volumes:
- ./config/settings.json:/home/node/app/test/config/settings.json
- ./config/datasources.dev.json:/config/datasources.1.json
- v3_dev:/home/node/app
- ./entrypoints/merge_json.sh:/docker-entrypoints/0.sh
- ${PWD}/entrypoints/npm_ci.sh:/docker-entrypoints/1.sh

volumes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
services:
archivemock:
environment:
GITHUB_REPO: https://github.com/SciCatProject/ScicatArchiveMock.git
extends:
file: ${PWD}/services/compose.dev.yaml
service: web-app
labels: !reset null
volumes:
- archivemock_dev:/job_mock
- ${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
entrypoint: loop_entrypoints.sh
command: infinite_loop.sh
healthcheck:
test: pgrep -f "/bin/sh /usr/local/bin/infinite_loop.sh"
user: root

volumes:
Expand Down
2 changes: 1 addition & 1 deletion main/services/backend/services/v4/compose.base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
volumes:
- ./config/functionalAccounts.json:/home/node/app/functionalAccounts.json
- ${PWD}/entrypoints/loop_entrypoints.sh:/usr/local/bin/loop_entrypoints.sh
- ./entrypoints/db_migration.sh:/docker-entrypoints/0.sh
- ./entrypoints/db_migration.sh:/docker-entrypoints/1.sh
entrypoint:
- loop_entrypoints.sh
- docker-entrypoint.sh
Expand Down
9 changes: 3 additions & 6 deletions main/services/backend/services/v4/compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
services:
backend:
image: !reset null
extends:
file: ${PWD}/services/compose.dev.yaml
service: node-app-from-remote
build:
context: https://github.com/SciCatProject/scicat-backend-next.git
target: dev
environment:
GITHUB_REPO: https://github.com/SciCatProject/scicat-backend-next.git
volumes:
- v4_dev:/home/node/app
- ${PWD}/entrypoints/setup_git.sh:/docker-entrypoints/2.sh
- ./config/functionalAccounts.dev.json:/home/node/app/functionalAccounts.json
env_file:
- ./config/.dev.env
Expand Down
29 changes: 29 additions & 0 deletions main/services/compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
services:
web-app:
entrypoint: loop_entrypoints.sh
command: infinite_loop.sh
healthcheck:
test: pgrep -f "/bin/sh /usr/local/bin/infinite_loop.sh"
retries: 10
labels:
- traefik.http.services.${APP}.loadbalancer.server.port=${DEV_PORT}
volumes:
# These volumes allow to run init scripts before running the service
- ${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
environment:
GITHUB_REPO: ${GITHUB_REPO:-}
node-app-from-local:
extends: web-app
volumes:
# This prevents git unpushed changes from being lost on container restart
- ${DEV_VOLUME:-${APP}}_dev:${WORKDIR:-/home/node/app}
# These allow to keep changes from npm install/build from Dockerfile CMDs
- ${WORKDIR:-/home/node/app}/dist
- ${WORKDIR:-/home/node/app}/node_modules
node-app-from-remote:
extends: node-app-from-local
image: ''
build:
context: ${GITHUB_REPO:-}
17 changes: 4 additions & 13 deletions main/services/frontend/compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
services:
frontend:
image: !reset null
extends:
file: ${PWD}/services/compose.dev.yaml
service: node-app-from-remote
build:
context: https://github.com/SciCatProject/frontend.git
target: builder
command: infinite_loop.sh
environment:
CONFIG_DIR: /frontend/src/assets
GITHUB_REPO: https://github.com/SciCatProject/frontend.git
CONFIG_DIR: ${WORKDIR}/src/assets
CHROME_BIN: /usr/bin/chromium
volumes:
- frontend_dev:/frontend
- ${PWD}/entrypoints/infinite_loop.sh:/usr/local/bin/infinite_loop.sh
- ${PWD}/entrypoints/setup_git.sh:/docker-entrypoints/0.sh
- ${PWD}/entrypoints/add_chrome.sh:/docker-entrypoints/2.sh
labels:
- traefik.http.services.frontend.loadbalancer.server.port=4200
healthcheck:
test: pgrep -f "/bin/sh /usr/local/bin/infinite_loop.sh"
retries: 5

volumes:
frontend_dev:
Expand Down
19 changes: 4 additions & 15 deletions main/services/landingpage/compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
services:
landingpage:
image: !reset null
extends:
file: ${PWD}/services/compose.dev.yaml
service: node-app-from-remote
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
CONFIG_DIR: ${WORKDIR:-/home/node/app}/src/assets
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
- ${PWD}/entrypoints/merge_json.sh:/docker-entrypoints/1.sh
- ${PWD}/entrypoints/add_chrome.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:
Expand Down
20 changes: 3 additions & 17 deletions main/services/searchapi/compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
services:
searchapi:
environment:
GITHUB_REPO: https://github.com/SciCatProject/panosc-search-api.git
extends:
file: ${PWD}/services/compose.dev.yaml
service: node-app-from-local
volumes:
# These prevents git unpushed changes from being lost on container restart
- searchapi_dev:/home/node/app
# These volumes allow to run init scripts before running the service
- ${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
- ${PWD}/entrypoints/npm_ci.sh:/docker-entrypoints/1.sh
entrypoint:
- loop_entrypoints.sh
# This is the NODE original entrypoint
- docker-entrypoint.sh
command: infinite_loop.sh
labels:
- traefik.http.services.searchapi.loadbalancer.server.port=3000
healthcheck:
test: pgrep -f "/bin/sh /usr/local/bin/infinite_loop.sh"
user: root
env_file:
- ./config/.dev.env
Expand Down

0 comments on commit f5f1fdc

Please sign in to comment.