Skip to content

Commit

Permalink
[New] Add docker-services for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Nov 23, 2023
1 parent 1a0d627 commit 48e1d0e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
23 changes: 14 additions & 9 deletions deploy/internal-auth/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
version: '3'
version: '3.9'

# Provide access to record-manager-ui that runs locally in dev mode
x-access-for-local-development: &local-dev-env
cors.allowedOrigins: "http://localhost:3000"

services:
nginx:
Expand All @@ -18,8 +22,8 @@ services:
record-manager:
image: ghcr.io/kbss-cvut/kbss-cvut/record-manager-ui:latest
container_name: ${RECORD_SET_NAME:-rm}-record-manager
ports:
- "4000:80"
expose:
- "80"
restart: always
depends_on:
- record-manager-server
Expand All @@ -34,13 +38,14 @@ services:
record-manager-server:
image: ghcr.io/kbss-cvut/kbss-cvut/record-manager:latest
container_name: ${RECORD_SET_NAME:-rm}-record-manager-server
ports:
- "3000:8080"
expose:
- "8080"
restart: always
depends_on:
- s-pipes-engine
- db-server
environment:
<<: *local-dev-env
appContext: "http://localhost:${PORT:-1235}/record-manager/"
repositoryUrl: "http://db-server:7200/repositories/record-manager-app"
formGenRepositoryUrl: "http://db-server:7200/repositories/record-manager-formgen"
Expand All @@ -49,8 +54,8 @@ services:
s-pipes-engine:
image: ghcr.io/kbss-cvut/s-pipes/s-pipes-engine:latest
container_name: ${RECORD_SET_NAME:-rm}-s-pipes-engine
ports:
- "8889:8080"
expose:
- "8080"
restart: always
depends_on:
- db-server
Expand All @@ -65,8 +70,8 @@ services:
container_name: ${RECORD_SET_NAME:-rm}-db-server
environment:
GDB_JAVA_OPTS: -Dgraphdb.external-url=http://localhost:$PORT$RECORD_MANAGER_BASENAME/db-server
ports:
- "7200:7200"
expose:
- "7200"
restart: always
volumes:
- db-server:/opt/graphdb/home
Expand Down
15 changes: 15 additions & 0 deletions doc/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ To configure the application use [Setup Guide](./setup.md).
To run application in development mode use `npm run dev`.
By default, the application is accessible from http://localhost:3000.

### Running with Dockerized Services and Internal Authorization

This section adds notes about the development scenario, when developer uses
[dockerized services with internal authorization](../deploy/internal-auth/docker-compose.yml) to develop.
All the services including dockerized record-manager-ui runs on by default at `http://localhost:1235/record-manager`.
To attach simultaneously frontend for the development use setup from [.env.internal-auth](../.env.internal-auth),
e.g. by running `ln -s .env.internal-auth .env; npm run dev`.

### Running with all Services in Development Mode

This section adds notes about the development scenario, when developer runs all dependant services in development mode.
By default, Record Manager UI runs at `http://localhost:3000` while Record Manager Server runs at different port.
This requires to set up CORS policy of the server appropriately, i.e. configure `config.properties`
to contain `security.sameSite=None` and if needed set up also `cors.allowedOrigin`.

## Add Configuration Parameters

When runtime configuration parameters are added to the application, they also need to be added to Docker processing so
Expand Down

0 comments on commit 48e1d0e

Please sign in to comment.