diff --git a/docker-compose-build.yml b/docker-compose-build.yml new file mode 100644 index 0000000..163cf1b --- /dev/null +++ b/docker-compose-build.yml @@ -0,0 +1,143 @@ +version: "3.2" + + # Starts ebics-service with a libeufin as a banking backend + + +services: + postgres: + container_name: pg + image: postgres:11 + restart: always + environment: + - POSTGRES_USER=pgrootuser + - POSTGRES_PASSWORD=pgrootpassword + - POSTGRES_DB=libeufindb + - POSTGRES_NON_ROOT_USER=pguser + - POSTGRES_NON_ROOT_PASSWORD=pgpassword + # - PGDATA="/var/lib/postgresql/data/pgdata" + # ports: + # - "5432:5432" + + libeufin: + container_name: libeufin + # image: e36io/libeufin:hyperfridge + # local dev: + build: + context: ../LibEuFin + + depends_on: + - postgres + environment: + - LIBEUFIN_SANDBOX_URL=http://localhost:5016/ + - LIBEUFIN_SANDBOX_DB_CONNECTION=jdbc:postgresql://postgres:5432/libeufindb?user=pgrootuser&password=pgrootpassword + - LIBEUFIN_NEXUS_DB_CONNECTION=jdbc:postgresql://postgres:5432/libeufindb?user=pgrootuser&password=pgrootpassword + - LIBEUFIN_NEXUS_URL=http://localhost:5000/ + - LIBEUFIN_NEXUS_USERNAME=foo + - LIBEUFIN_NEXUS_PASSWORD=superpassword + - LIBEUFIN_SANDBOX_ADMIN_PASSWORD=superpassword + - LIBEUFIN_SANDBOX_USERNAME=admin + - LIBEUFIN_SANDBOX_PASSWORD=superpassword + + - EBICS_BASE_URL=http://localhost:5016/ebicsweb + - POSTGRES_USER=pgrootuser + - POSTGRES_PASSWORD=pgrootpassword + - POSTGRES_HOST=postgres + - POSTGRES_DB=libeufindb + - DANGEROUSLY_DISABLE_HOST_CHECK=true + + # not used because they are default values + # - CLIENT_PR_KEY_OUT=/app/keys/client_private_key.pem + # - CLIENT_PUB_KEY_OUT=/app/keys/client_public_key.pem + # - BANK_PUB_KEY_OUT=/app/keys/bank_public_key.pem + + command: /app/scripts/init_libeufin_sandbox.sh + tty: true + stdin_open: true # without this node doesn't start; https://stackoverflow.com/questions/61857267/how-to-make-yarn-start-work-inside-docker-image-with-react-scripts-3-4-and-babel + ports: + - "5016:5016" # sandbox + - "5001:5000" # nexus + - "3000:3000" # ui - login: foo/superpassword + expose: + - 5016 + - 3000 + - 5001 + volumes: + - ./scripts:/app/scripts:rw + - ./keys:/app/keys:rw + - ./trace:/app/trace:rw + + ebics-service: + # image: e36io/ebics-service:hyperfridge + container_name: ebics + build: + context: . + depends_on: + - libeufin + environment: + - spring_profiles_active=sandbox + - LIBEUFIN_SANDBOX_URL=http://libeufin:5016 # overwrite localhost in configs + - LIBEUFIN_NEXUS_URL=http://libeufin:5000 + - LIBEUFIN_SANDBOX_ADMIN_PASSWORD=superpassword + - LIBEUFIN_SANDBOX_USERNAME=admin + - LIBEUFIN_SANDBOX_PASSWORD=superpassword + - FRIDGE_OUT_DIR=file:/app/work_out/ + ports: + - "8093:8093" + expose: + - 8093 + volumes: + - recipie-dir:/app/work_out/:rw + + hyperfridge: + container_name: fridge + # image: e36io/hyperfridge-r0:latest + build: + context: /home/w/workspace/hyperfridge-r0 + dockerfile: ${DOCKERFILE:-DockerfileLinux} # Default to DockerfileLinux, override with DOCKERFILE environment variable if provided + + environment: + # for watchdog.sh which generates a new proof in /app/out/ as soon as new file ebics file is dedected in /app/in/ + - CLIENT_PR_KEY=/app/keys/client_private_key.pem + - CLIENT_PUB_KEY=/app/keys/client_public_key.pem + - BANK_PUB_KEY=/app/keys/bank_public_key.pem + - WITNESS_PUB_KEY=/data/pub_witness.pem + - WITNESS_PR_KEY=/data/witness.pem + - IN_DIR=/app/in/ + - WORK_DIR=/app/work/ + - OUT_DIR=/app/out/ + - HOST_CMD=/app/host + command: /data/watchdog.sh + working_dir: /data + volumes: + - recipie-dir:/app/out/:rw + - ./keys/:/app/keys/:ro + - ./trace:/app/in:ro + # for DEV + # - /home/w/workspace/hyperfridge-r0/data/checkResponse.sh:/data/checkResponse.sh + # - /home/w/workspace/hyperfridge-r0/data/watchdog.sh:/data/watchdog.sh + + pgadmin: + profiles: + - dev + container_name: dbadmin + image: dpage/pgadmin4:7.6 + environment: + PGADMIN_DEFAULT_EMAIL: admin@example.com + PGADMIN_DEFAULT_PASSWORD: root + MAX_LOGIN_ATTEMPTS: '15' # Ensure this is a string, not a number + POSTGRES_USER: pgrootuser + POSTGRES_PASSWORD: pgrootpassword + POSTGRES_HOST: postgres + POSTGRES_DB: libeufindb + DANGEROUSLY_DISABLE_HOST_CHECK: 'true' # Ensure this is a string, not a boolean + + depends_on: + - postgres + volumes: + - /home/w/pgadmin:/var/lib/pgadmin:rw + user: root + ports: + - "53603:53603" + - "8081:80" #mapped on w.e36.io:35050; admin@example.com root; add server medi medi medi +volumes: + recipie-dir: \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index eea15b9..d3303fa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -89,8 +89,6 @@ services: - recipie-dir:/app/work_out/:rw hyperfridge: - # profiles: - # - dev container_name: fridge image: e36io/hyperfridge-r0:latest # build: diff --git a/docs/TEST.md b/docs/TEST.md index a0d363a..b33ff41 100644 --- a/docs/TEST.md +++ b/docs/TEST.md @@ -28,10 +28,16 @@ If you are interested in the Ebics Client implementation as well, look [here](ht This starts several docker images: ebics-java-service => libeufin => Postgres. We use 'watchdog.sh' from the hyperfridge image to scan directory for new banking documents which triggers generation of STARK proofs. - docker compose up + + docker compose pull + docker compose up -d + # optional + docker compose logs -f -You should see the setup process of demo-accounts, lauching [Open API/Swagger](http://localhost:8093/ebics/swagger-ui/?url=/ebics/v2/api-docs/) and [banking bankend](manual/manual.md) which we will look at later. +Startup will take some time - up to 3 o5 minutes. +You should be able to [open Swagger](http://localhost:8093/ebics/swagger-ui/?url=/ebics/v2/api-docs/) and log into [banking bankend](manual/manual.md) which we will look at later. +We tested on MacOs. In case this is not working, you may ## Test API and download ZK proof diff --git a/docs/docker-build.md b/docs/docker-build.md new file mode 100644 index 0000000..46a5bf2 --- /dev/null +++ b/docs/docker-build.md @@ -0,0 +1,27 @@ +# Build locally with docker + +Clone repos which are necessary into the parent directory of ebics-java-service. + + + git clone git@github.com:element36-io/LibEuFin.git + cd LibEuFin + git checkout hyperfridge + + cd .. + git git@github.com:element36-io/hyperfridge-r0.git + + +Build locally, may take several hours: + + cd .. + cd ebics-java-service + docker compose -f docker-compose-build.yml build + + +Start container + + docker compouse up -d + docker compose logs + + +