diff --git a/README.md b/README.md index d845143b..37740891 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,21 @@ # Polkascan PRE Polkascan PRE Main Application -## Run application +## Run application (Prebuilt Docker Hub images) + +* During the first run let MySQL initialize (wait for 30 seconds) + +```bash +docker-compose up -d mysql +``` + +* Then start the other docker containers +```bash +docker-compose up +``` + +## Run application (Build from source) + * Make sure to also clone submodules within the cloned directory: ```bash git submodule update --init --recursive @@ -9,12 +23,14 @@ git submodule update --init --recursive * During the first run let MySQL initialize (wait for 30 seconds) ```bash -docker-compose up -d mysql +docker-compose -f docker-compose.dev.yml up -d mysql ``` -* Then start the docker containers +* Then build the other docker containers ```bash -docker-compose up --build +docker-compose -f docker-compose.dev.yml up --build ``` +## Links + * Polkascan Explorer GUI: http://127.0.0.1:8080 * Harvester task monitor: http://127.0.0.1:5555 * Harvester progress: http://127.0.0.1:8080/harvester/admin \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 00000000..c5ef5872 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,97 @@ +version: '3.2' + +services: + + explorer-api: + build: explorer-api/. + image: polkascan/pre-explorer-api:milestone1 + ports: + - '8001:8000' + volumes: + - './explorer-api:/usr/src/app' + command: ./start.sh + environment: + - PYTHONPATH=/usr/src/app + - ENVIRONMENT=dev + depends_on: + - mysql + + harvester-api: + build: harvester/. + image: polkascan/pre-harvester:milestone1 + ports: + - '8000:8000' + volumes: + - './harvester:/usr/src/app' + command: ./start.sh + environment: &env + - CELERY_BROKER=redis://redis:6379/0 + - CELERY_BACKEND=redis://redis:6379/0 + - PYTHONPATH=/usr/src/app + - ENVIRONMENT=dev + depends_on: + - redis + - mysql + - substrate-node + + harvester-worker: + build: harvester/. + image: polkascan/pre-harvester:milestone1 + volumes: + - './harvester:/usr/src/app' + command: celery -A app.tasks worker --loglevel=INFO + environment: *env + depends_on: + - redis + - mysql + + harvester-beat: + build: harvester/. + image: polkascan/pre-harvester:milestone1 + volumes: + - './harvester:/usr/src/app' + - './data/celerybeat:/usr/src/app/data' + command: celery -A app.tasks beat --loglevel=INFO --schedule="data/celerybeat-schedule" --pidfile="data/celerybeat.pid" + environment: *env + depends_on: + - redis + + harvester-monitor: + build: harvester/. + image: polkascan/pre-harvester:milestone1 + ports: + - '5555:5555' + command: flower -A app.tasks --port=5555 --broker=redis://redis:6379/0 + depends_on: + - redis + + redis: + image: redis:3.2.11 + + mysql: + image: mysql:latest + volumes: + - './data/mysql:/var/lib/mysql' + ports: + - '33061:3306' + environment: + - MYSQL_ROOT_PASSWORD=root + - MYSQL_DATABASE=polkascan + + substrate-node: + image: polkasource/substrate-alexander:latest + volumes: + - './data/substrate:/data' + ports: + - '30333:30333' + - '9933:9933' + - '9944:9944' + command: --dev --rpc-port 9933 --rpc-external --pruning=10000000 + + explorer-gui: + image: polkascan/pre-explorer-gui:milestone1 + build: explorer-gui/. + ports: + - '8080:80' + depends_on: + - harvester-api \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 0e057afe..ed857d10 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,7 @@ version: '3.2' services: explorer-api: - build: explorer-api/. - image: polkascan-explorer-api + image: polkascan/pre-explorer-api:milestone1 ports: - '8001:8000' volumes: @@ -17,8 +16,7 @@ services: - mysql harvester-api: - build: harvester/. - image: &harvester-app polkascan-harvester + image: polkascan/pre-harvester:milestone1 ports: - '8000:8000' volumes: @@ -35,8 +33,7 @@ services: - substrate-node harvester-worker: - build: harvester/. - image: *harvester-app + image: polkascan/pre-harvester:milestone1 volumes: - './harvester:/usr/src/app' command: celery -A app.tasks worker --loglevel=INFO @@ -46,8 +43,7 @@ services: - mysql harvester-beat: - build: harvester/. - image: *harvester-app + image: polkascan/pre-harvester:milestone1 volumes: - './harvester:/usr/src/app' - './data/celerybeat:/usr/src/app/data' @@ -57,8 +53,7 @@ services: - redis harvester-monitor: - build: harvester/. - image: *harvester-app + image: polkascan/pre-harvester:milestone1 ports: - '5555:5555' command: flower -A app.tasks --port=5555 --broker=redis://redis:6379/0 @@ -89,8 +84,7 @@ services: command: --dev --rpc-port 9933 --rpc-external --pruning=10000000 explorer-gui: - image: polkascan-explorer-gui - build: explorer-gui/. + image: polkascan/pre-explorer-gui:milestone1 ports: - '8080:80' depends_on: