Browse Source

Remove services with dependencies from docker compose

develop
Apostolos Fanakis 4 years ago
parent
commit
b300440165
  1. 22
      docker/Makefile
  2. 43
      docker/docker-compose.yml

22
docker/Makefile

@ -1,4 +1,4 @@
# Targets for building/running/stopping both apps (uses 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:
@ -8,6 +8,16 @@ stop:
stop-clean-data: stop-clean-data:
@docker-compose -f ./docker-compose.yml -p concordia down -v @docker-compose -f ./docker-compose.yml -p concordia down -v
# Ganache targets
build-ganache:
@docker build . -f ./ganache/Dockerfile -t concordia-ganache
run-ganache:
@docker-compose -f ./ganache/docker-compose.yml -p concordia up -d
# Rendezvous targets
run-rendezvous:
@docker-compose -f ./rendezvous/docker-compose.yml -p concordia up -d
# Contracts targets # Contracts targets
build-contracts: build-contracts:
@docker build ../ -f ./concordia-contracts/Dockerfile --target compile -t concordia-contracts --build-arg TZ=Europe/Athens @docker build ../ -f ./concordia-contracts/Dockerfile --target compile -t concordia-contracts --build-arg TZ=Europe/Athens
@ -43,16 +53,6 @@ run-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
# Ganache targets
build-ganache:
@docker build . -f ./ganache/Dockerfile -t concordia-ganache
run-ganache:
@docker-compose -f ./ganache/docker-compose.yml -p concordia up -d
# Rendezvous targets
run-rendezvous:
@docker-compose -f ./rendezvous/docker-compose.yml -p concordia up -d
# Other # Other
clean-images: clean-images:
@docker rmi `docker images -q -f "dangling=true"` @docker rmi `docker images -q -f "dangling=true"`

43
docker/docker-compose.yml

@ -10,17 +10,14 @@ services:
- 8545:8545 - 8545:8545
user: root user: root
volumes: volumes:
- ./volumes/ganache_db:/home/ganache_db - ./ganache/volumes/ganache_db:/home/ganache_db
- ./volumes/ganache_keys:/home/ganache_keys - ./ganache/volumes/ganache_keys:/home/ganache_keys
networks: networks:
ganache-network: ganache-network:
restart: always restart: always
# Simple rendezvous server image
# Reference:
# https://hub.docker.com/r/libp2p/websocket-star-rendezvous
rendezvous: rendezvous:
image: libp2p/websocket-star-rendezvous:release image: libp2p/js-libp2p-webrtc-star:version-0.20.1
container_name: rendezvous container_name: rendezvous
networks: networks:
rendezvous-network: rendezvous-network:
@ -28,40 +25,6 @@ services:
- 9090:9090 - 9090:9090
restart: always restart: always
concordia-contracts:
build:
dockerfile: ./docker/concordia-contracts/Dockerfile
context: ./..
args:
TZ: Europe/Athens
container_name: concordia-contracts-migrate
env_file:
- ./env/contracts.docker.env
volumes:
- ../packages/concordia-contracts/build/:/usr/src/concordia/packages/concordia-contracts/build/
depends_on:
- ganache
networks:
ganache-network:
concordia-app:
build:
dockerfile: ./docker/concordia-app/Dockerfile
context: ./..
args:
TZ: Europe/Athens
container_name: concordia-app
depends_on:
- concordia-contracts
- rendezvous
env_file:
- ./env/concordia.docker.env
networks:
ganache-network:
ports:
- 8473:80
restart: always
networks: networks:
ganache-network: ganache-network:
rendezvous-network: rendezvous-network:

Loading…
Cancel
Save