diff --git a/README.md b/README.md index e7ded68..b0088d7 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,20 @@ Run development server $ npm run dev ``` +## Development with Docker Compose +Here is the common procedure to debug individual services of the s-pipes-editor-ui. `` can be replaced +by one of the values `s-pipes-editor-ui`, `s-pipes-editor-rest` and `s-pipes-engine`. +1. cd to `$PROJECT_ROOT`. +2. Run `docker-compose -f docker-compose-dev.yml up` if not running already. Otherwise, run +`docker-compose -f docker-compose-dev.yml start`. +3. Stop the service which you want to develop `docker-compose -f docker-compose-dev.yml stop ` +4. Start `` in development environment + - `s-pipes-editor-ui` - run `npm run dev` + - `s-pipes-editor-rest` - start run/debug springboot configuration in IntelliJ IDEA + - `s-pipes-engine` - start run/debug springboot configuration in IntelliJ IDEA + +Composing up, start and stop can also be done trough docker desktop and intellij idea service tab. + ### Dockerization The docker image of SPipes Editor UI can be built by `docker build -t s-pipes-editor-ui .` diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml new file mode 100644 index 0000000..d167494 --- /dev/null +++ b/docker-compose-dev.yml @@ -0,0 +1,77 @@ +version: '3' + +services: + s-pipes-editor-ui: + image: 'ghcr.io/kbss-cvut/s-pipes-editor-ui/s-pipes-editor-ui:latest' + container_name: s-pipes-editor-ui + ports: + - '3000:80' + networks: + - overlay + depends_on: + - s-pipes-editor-rest + environment: + - SERVICE_URL=${SPIPES_EDITOR_REST:-http://host.docker.internal:18115} + + s-pipes-editor-rest: + image: 'ghcr.io/kbss-cvut/s-pipes-editor/s-pipes-editor:latest' + container_name: s-pipes-editor-rest + ports: + - ${EDITOR_REST_PORT:-18115}:18115 + expose: + - "18115" + networks: + - overlay + depends_on: + - s-pipes-engine + - rdf4j + environment: + - SCRIPTPATHS=${SCRIPTPATHS:-${PWD}/../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../s-pipes/doc/examples}} + - SCRIPTRULES=${SCRIPTRULES:-${PWD}/../s-pipes-editor/src/main/resources/rules} + - ENGINEURL=${SPIPES_ENGINE:-http://host.docker.internal:8081/s-pipes/} + - RDF4J_REPOSITORYURL=${RDF4J_SERVER_URL:-http://rdf4j:8080/rdf4j-server}/repositories + - RDF4J_REPOSITORYNAME=${RDF4J_REPOSITORYNAME:-s-pipes-hello-world} + - RDF4J_PCONFIGURL=${RDF4J_PCONFIGURL:-../s-pipes/doc/examples/hello-world/config.ttl} + volumes: + - /tmp:/tmp + - ${SHARED_ROOT:-/home}:${SHARED_ROOT:-/home} + - /usr/local/tomcat/temp/:/usr/local/tomcat/temp/ + + + s-pipes-engine: + image: 'ghcr.io/kbss-cvut/s-pipes/s-pipes-engine:latest' +# container_name: s-pipes-engine + ports: + - ${SPIPES_PORT:-8081}:8080 + expose: + - "8080" + networks: + - overlay + depends_on: + - rdf4j + environment: + - CONTEXTS_SCRIPTPATHS=${SCRIPTPATHS:-${PWD}/../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../s-pipes/doc/examples}} + volumes: + - /tmp:/tmp + - ${SHARED_ROOT:-/home}:${SHARED_ROOT:-/home} + - /usr/local/tomcat/temp/:/usr/local/tomcat/temp/ + + rdf4j: + image: 'eclipse/rdf4j-workbench:3.7.7' + container_name: rdf4j + expose: + - "8080" + networks: + - overlay + environment: + - JAVA_OPTS=-Xms1g -Xmx4g + volumes: + - data:/var/rdf4j + - logs:/usr/local/tomcat/logs + +volumes: + data: + logs: + +networks: + overlay: