From 50003452b32f4785bf180ab4d01979dbef4308a4 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Sun, 22 Nov 2020 21:30:10 +0200 Subject: [PATCH] Fix general docker-compose.yml, Add env configurations for docker runs --- docker/Makefile | 4 ++-- docker/docker-compose.yml | 12 ++++++------ docker/env/concordia.docker.env | 3 +++ docker/env/contracts.docker.env | 4 ++++ 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 docker/env/concordia.docker.env create mode 100644 docker/env/contracts.docker.env diff --git a/docker/Makefile b/docker/Makefile index 84b5937..de44a80 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -21,7 +21,7 @@ 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-migrate: @cd .. &&\ - docker run --rm -v `pwd`/packages/concordia-contracts/build/:/usr/src/concordia/packages/concordia-contracts/build/ --env-file=./docker/env/contracts.env --net=concordia_ganache-network concordia-contracts-migrate:latest + 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 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 @@ -37,7 +37,7 @@ build-app-tests: run-app-tests: @docker run --rm -v `pwd`/reports/app/:/usr/test-reports/ --env-file=./env/concordia.env concordia-app-tests:latest run-app: - @docker create --env-file=./env/concordia.env -p 8473:80 --name concordia-app --net=concordia_ganache-network concordia-app:latest &&\ + @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 &&\ docker start concordia-app run-app-host-chain: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 72877ba..12305c3 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -34,10 +34,11 @@ services: context: ./.. args: TZ: Europe/Athens - SKIP_TESTS: "true" - container_name: concordia-contracts + container_name: concordia-contracts-migrate env_file: - - ./env/contracts.env + - ./env/contracts.docker.env + volumes: + - ../packages/concordia-contracts/build/:/usr/src/concordia/packages/concordia-contracts/build/ depends_on: - ganache networks: @@ -49,17 +50,16 @@ services: context: ./.. args: TZ: Europe/Athens - SKIP_TESTS: "true" container_name: concordia-app depends_on: - concordia-contracts - rendezvous env_file: - - ./env/concordia.env + - ./env/concordia.docker.env networks: ganache-network: ports: - - 3000:80 + - 8473:80 restart: always networks: diff --git a/docker/env/concordia.docker.env b/docker/env/concordia.docker.env new file mode 100644 index 0000000..b2cc799 --- /dev/null +++ b/docker/env/concordia.docker.env @@ -0,0 +1,3 @@ +# Variables needed in runtime (in browser) +REACT_APP_RENDEZVOUS_HOST=rendezvous +REACT_APP_RENDEZVOUS_PORT=9090 diff --git a/docker/env/contracts.docker.env b/docker/env/contracts.docker.env new file mode 100644 index 0000000..e50ecef --- /dev/null +++ b/docker/env/contracts.docker.env @@ -0,0 +1,4 @@ +# Variables needed in runtime +MIGRATE_NETWORK=develop +DEVELOP_CHAIN_HOST=ganache +DEVELOP_CHAIN_PORT=8545