diff --git a/deploy/internal-auth/docker-compose.yml b/deploy/internal-auth/docker-compose.yml index 3d9e6be8..87de91ef 100644 --- a/deploy/internal-auth/docker-compose.yml +++ b/deploy/internal-auth/docker-compose.yml @@ -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: @@ -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 @@ -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" @@ -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 @@ -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 diff --git a/doc/development.md b/doc/development.md index 3bf06c72..a0d0f20f 100644 --- a/doc/development.md +++ b/doc/development.md @@ -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