Browse Source

Update docker-compose.yml and Makefile

develop
Apostolos Fanakis 4 years ago
parent
commit
ba102d2d88
  1. 23
      docker/Makefile
  2. 19
      docker/docker-compose.yml

23
docker/Makefile

@ -1,6 +1,6 @@
# Targets for building/running/stopping the blockchain and rendezvous server (using the docker-compose file) # Targets for building/running/stopping the blockchain and rendezvous server (using the docker-compose file)
build: build:
@docker-compose -f ./docker-compose.yml -p concordia build; @docker-compose -f ./docker-compose.yml -p concordia build
run: run:
@docker-compose -f ./docker-compose.yml -p concordia up -d @docker-compose -f ./docker-compose.yml -p concordia up -d
stop: stop:
@ -10,15 +10,18 @@ stop-clean-data:
# Ganache targets # Ganache targets
build-ganache: build-ganache:
@docker build . -f ./ganache/Dockerfile -t concordia-ganache @docker build ../ -f ./ganache/Dockerfile -t concordia-ganache
run-ganache: run-ganache:
@docker-compose -f ./ganache/docker-compose.yml -p concordia up -d @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
run-ganache-test: run-ganache-test:
@docker-compose -f ./ganache/docker-compose.test.yml -p concordia up -d @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
# Rendezvous targets # Rendezvous targets
run-rendezvous: run-rendezvous:
@docker-compose -f ./rendezvous/docker-compose.yml -p concordia up -d @docker network create --driver bridge concordia_rendezvous_network || true &&\
docker run -d -p 9090:9090 --name concordia-rendezvous libp2p/js-libp2p-webrtc-star:version-0.20.1
# Contracts targets # Contracts targets
build-contracts: build-contracts:
@ -28,12 +31,12 @@ build-contracts-migrate:
build-contracts-tests: build-contracts-tests:
@docker build ../ -f ./concordia-contracts/Dockerfile --target test -t concordia-contracts-tests --build-arg TZ=Europe/Athens @docker build ../ -f ./concordia-contracts/Dockerfile --target test -t concordia-contracts-tests --build-arg TZ=Europe/Athens
run-contract-tests: run-contract-tests:
@docker run --rm -v `pwd`/reports/contracts/:/usr/test-reports/ --env-file=./env/contracts.env --net=concordia_ganache-test-network concordia-contracts-tests:latest @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: 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 @docker run --rm -v `pwd`/reports/contracts/:/usr/test-reports/ --env-file=./env/contracts.env --net=host concordia-contracts-tests:latest
run-contracts-migrate: run-contracts-migrate:
@cd .. &&\ @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 `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: run-contracts-migrate-host-chain:
@cd .. &&\ @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 `pwd`/packages/concordia-contracts/build/:/usr/src/concordia/packages/concordia-contracts/build/ --env-file=./docker/env/contracts.env --net=host concordia-contracts-migrate:latest
@ -47,10 +50,10 @@ build-app:
build-app-tests: build-app-tests:
@docker build ../ -f ./concordia-app/Dockerfile --target test -t concordia-app-tests --build-arg TZ=Europe/Athens @docker build ../ -f ./concordia-app/Dockerfile --target test -t concordia-app-tests --build-arg TZ=Europe/Athens
run-app-tests: run-app-tests:
@docker run --rm -v `pwd`/reports/app/:/usr/test-reports/ --env-file=./env/concordia.env concordia-app-tests:latest @docker run --rm -v `pwd`/reports/app/:/usr/test-reports/ --env-file=./env/concordia.docker.env concordia-app-tests:latest
run-app: run-app:
@docker create --env-file=./env/concordia.docker.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 network connect concordia_rendezvous_network concordia-app &&\
docker start concordia-app docker start concordia-app
run-app-host-chain: run-app-host-chain:
@docker run -d --env-file=./env/concordia.env --name concordia-app --net=host concordia-app:latest @docker run -d --env-file=./env/concordia.env --name concordia-app --net=host concordia-app:latest

19
docker/docker-compose.yml

@ -2,8 +2,13 @@ version: '3.8'
services: services:
ganache: ganache:
build: ganache build:
container_name: ganache context: ../
dockerfile: ./docker/ganache/Dockerfile
image: concordia-ganache
container_name: concordia-ganache
env_file:
- env/ganache.env
expose: expose:
- 8545 - 8545
ports: ports:
@ -13,18 +18,18 @@ services:
- ./ganache/volumes/ganache_db:/home/ganache_db - ./ganache/volumes/ganache_db:/home/ganache_db
- ./ganache/volumes/ganache_keys:/home/ganache_keys - ./ganache/volumes/ganache_keys:/home/ganache_keys
networks: networks:
ganache-network: ganache_network:
restart: always restart: always
rendezvous: rendezvous:
image: libp2p/js-libp2p-webrtc-star:version-0.20.1 image: libp2p/js-libp2p-webrtc-star:version-0.20.1
container_name: rendezvous container_name: concordia-rendezvous
networks: networks:
rendezvous-network: rendezvous_network:
ports: ports:
- 9090:9090 - 9090:9090
restart: always restart: always
networks: networks:
ganache-network: ganache_network:
rendezvous-network: rendezvous_network:

Loading…
Cancel
Save