From 91075d0301b022e3eee1829642cc2a785a4fa03c Mon Sep 17 00:00:00 2001 From: apostolof Date: Sun, 14 Feb 2021 18:38:01 +0200 Subject: [PATCH] fix: various docker fixes --- docker/Makefile | 10 ++++++---- docker/env/contracts-test.env | 4 ++++ docker/env/contracts.env | 4 +--- docker/ganache/Dockerfile | 2 +- packages/concordia-contracts/index.js | 1 + 5 files changed, 13 insertions(+), 8 deletions(-) create mode 100755 docker/env/contracts-test.env diff --git a/docker/Makefile b/docker/Makefile index 8806a2f..9e9ec61 100755 --- a/docker/Makefile +++ b/docker/Makefile @@ -11,6 +11,9 @@ run: compose-run build-contracts-provider run-contracts-provider build-contracts run-staging: compose-run build-contracts-provider run-contracts-provider-staging build-contracts-migrate run-contracts-migrate build-pinner run-pinner-staging build-app-staging run-app-staging @echo "Concordia is up and running, head over to http://localhost:7000." +prepare-network: + @docker network create --driver bridge concordia_concordia_network || true + # Targets for building/running/stopping the blockchain and rendezvous server (using the docker-compose file) compose-build: @docker-compose -f ./docker-compose.yml -p concordia build @@ -31,8 +34,7 @@ run-ganache-test: # Rendezvous targets run-rendezvous: - @docker network create --driver bridge concordia_concordia_network || true &&\ - docker run -d -p 9090:9090 --name concordia-rendezvous --net=concordia_concordia_network libp2p/js-libp2p-webrtc-star:version-0.20.5 + @docker run -d -p 9090:9090 --name concordia-rendezvous --net=concordia_concordia_network libp2p/js-libp2p-webrtc-star:version-0.20.5 # Contracts targets build-contracts: @@ -42,9 +44,9 @@ build-contracts-migrate: build-contracts-tests: @docker build ../ -f ./concordia-contracts/Dockerfile --target test -t ecentrics/concordia-contracts-tests --build-arg TZ=Europe/Athens run-contracts-tests: - @docker run --rm -v ${REPORTS}/contracts/:/mnt/concordia/test-reports/ --env-file=./env/contracts.env --net=concordia_concordia_network ecentrics/concordia-contracts-tests:latest + @docker run --rm -v ${REPORTS}/contracts/:/mnt/concordia/test-reports/ --env-file=./env/contracts-test.env --net=concordia_concordia_network ecentrics/concordia-contracts-tests:latest run-contracts-tests-host-chain: - @docker run --rm -v ${REPORTS}/contracts/:/mnt/concordia/test-reports/ --env-file=./env/contracts.env --net=host ecentrics/concordia-contracts-tests:latest + @docker run --rm -v ${REPORTS}/contracts/:/mnt/concordia/test-reports/ --env-file=./env/contracts-test.env --net=host ecentrics/concordia-contracts-tests:latest run-contracts-migrate: @docker run --rm -v ${PACKAGES}/concordia-contracts/build/:/usr/src/concordia/packages/concordia-contracts/build/ --env-file=./env/contracts.env --net=concordia_concordia_network ecentrics/concordia-contracts-migrate:latest run-contracts-migrate-host-chain: diff --git a/docker/env/contracts-test.env b/docker/env/contracts-test.env new file mode 100755 index 0000000..8489346 --- /dev/null +++ b/docker/env/contracts-test.env @@ -0,0 +1,4 @@ +# Variables needed in runtime +MIGRATE_NETWORK=env +WEB3_HOST=concordia-ganache-test +WEB3_PORT=8546 diff --git a/docker/env/contracts.env b/docker/env/contracts.env index f5d51f8..4e68772 100755 --- a/docker/env/contracts.env +++ b/docker/env/contracts.env @@ -5,6 +5,4 @@ WEB3_PORT=8545 CONTRACTS_PROVIDER_HOST=concordia-contracts-provider CONTRACTS_PROVIDER_PORT=8400 - -TEST_CHAIN_HOST=concordia-ganache-test -TEST_CHAIN_PORT=8546 +CONTRACTS_VERSION_TAG=docker diff --git a/docker/ganache/Dockerfile b/docker/ganache/Dockerfile index 11e7f39..a97baef 100644 --- a/docker/ganache/Dockerfile +++ b/docker/ganache/Dockerfile @@ -1,6 +1,6 @@ FROM trufflesuite/ganache-cli:v6.12.2@sha256:c062707f17f355872d703cde3de6a12fc45a027ed42857c72514171a5f466ab7 -RUN mkdir /home/ganache_db /home/ganache_keys +RUN mkdir -p /mnt/concordia/ganache_db /mnt/concordia/ganache_keys WORKDIR /opt/concordia-ganache diff --git a/packages/concordia-contracts/index.js b/packages/concordia-contracts/index.js index b877f71..6dcdcf3 100644 --- a/packages/concordia-contracts/index.js +++ b/packages/concordia-contracts/index.js @@ -1,3 +1,4 @@ +/* eslint-disable import/no-unresolved */ let Forum, Voting, PostVoting; /* eslint-disable global-require */