diff --git a/docker/Makefile b/docker/Makefile index 408a52f..3caa06f 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,3 +1,7 @@ +PACKAGES := $(abspath ${CURDIR}/../packages) +REPORTS := $(abspath ${CURDIR}/reports) +GANACHE_VOLUMES := $(abspath ${CURDIR}/ganache/volumes) + # Targets for building/running/stopping the blockchain and rendezvous server (using the docker-compose file) build: @docker-compose -f ./docker-compose.yml -p concordia build @@ -13,7 +17,7 @@ build-ganache: @docker build ../ -f ./ganache/Dockerfile -t concordia-ganache run-ganache: @docker network create --driver bridge concordia_ganache_network || true &&\ - docker run -d -v `pwd`/volumes/ganache_db:/home/ganache_db -v `pwd`/volumes/ganache_keys:/home/ganache_keys -p 8545:8545 --env-file=./env/ganache.env --name concordia-ganache --net=concordia_ganache_network concordia-ganache:latest + docker run -d -v ${GANACHE_VOLUMES}/ganache_db:/home/ganache_db -v ${GANACHE_VOLUMES}/ganache_keys:/home/ganache_keys -p 8545:8545 --env-file=./env/ganache.env --name concordia-ganache --net=concordia_ganache_network concordia-ganache:latest run-ganache-test: @docker network create --driver bridge concordia_ganache_test_network || true &&\ docker run --rm -d -p 8546:8546 --env-file=./env/ganache.test.env --name concordia-ganache-test --net=concordia_ganache_test_network concordia-ganache:latest @@ -30,19 +34,16 @@ build-contracts-migrate: @docker build ../ -f ./concordia-contracts/Dockerfile -t concordia-contracts-migrate --build-arg TZ=Europe/Athens build-contracts-tests: @docker build ../ -f ./concordia-contracts/Dockerfile --target test -t concordia-contracts-tests --build-arg TZ=Europe/Athens -run-contract-tests: - @docker run --rm -v `pwd`/reports/contracts/:/usr/test-reports/ --env-file=./env/contracts.docker.env --net=concordia_ganache_test_network concordia-contracts-tests:latest -run-contract-tests-host-chain: - @docker run --rm -v `pwd`/reports/contracts/:/usr/test-reports/ --env-file=./env/contracts.env --net=host concordia-contracts-tests:latest +run-contracts-tests: + @docker run --rm -v ${REPORTS}/contracts/:/usr/test-reports/ --env-file=./env/contracts.docker.env --net=concordia_ganache_test_network concordia-contracts-tests:latest +run-contracts-tests-host-chain: + @docker run --rm -v ${REPORTS}/contracts/:/usr/test-reports/ --env-file=./env/contracts.env --net=host concordia-contracts-tests:latest run-contracts-migrate: - @cd .. &&\ - docker run --rm -v `pwd`/packages/concordia-contracts/build/:/usr/src/concordia/packages/concordia-contracts/build/ --env-file=./docker/env/contracts.docker.env --net=concordia_ganache_network concordia-contracts-migrate:latest + @docker run --rm -v ${PACKAGES}/concordia-contracts/build/:/usr/src/concordia/packages/concordia-contracts/build/ --env-file=./env/contracts.docker.env --net=concordia_ganache_network concordia-contracts-migrate:latest run-contracts-migrate-host-chain: - @cd .. &&\ - docker run --rm -v `pwd`/packages/concordia-contracts/build/:/usr/src/concordia/packages/concordia-contracts/build/ --env-file=./docker/env/contracts.env --net=host concordia-contracts-migrate:latest + @docker run --rm -v ${PACKAGES}/concordia-contracts/build/:/usr/src/concordia/packages/concordia-contracts/build/ --env-file=./env/contracts.env --net=host concordia-contracts-migrate:latest get-contracts: - @cd .. && \ - docker run --rm -v `pwd`/packages/concordia-contracts/build/:/build --entrypoint=sh concordia-contracts:latest -c 'cp /usr/src/concordia/packages/concordia-contracts/build/* /build' + @docker run --rm -v ${PACKAGES}/concordia-contracts/build/:/build --entrypoint=sh concordia-contracts:latest -c 'cp /usr/src/concordia/packages/concordia-contracts/build/* /build' # App targets build-app: @@ -50,7 +51,7 @@ build-app: build-app-tests: @docker build ../ -f ./concordia-app/Dockerfile --target test -t concordia-app-tests --build-arg TZ=Europe/Athens run-app-tests: - @docker run --rm -v `pwd`/reports/app/:/usr/test-reports/ --env-file=./env/concordia.docker.env concordia-app-tests:latest + @docker run --rm -v ${REPORTS}/app/:/usr/test-reports/ --env-file=./env/concordia.docker.env concordia-app-tests:latest run-app: @docker create --env-file=./env/concordia.docker.env -p 8473:80 --name concordia-app --net=concordia_ganache_network concordia-app:latest &&\ docker network connect concordia_rendezvous_network concordia-app &&\