Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Commit

Permalink
Added separate docker compose file for building from source
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanz committed Apr 12, 2019
1 parent b5c4f96 commit 9b6e10a
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 16 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
# 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
```
* 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
97 changes: 97 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 6 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -17,8 +16,7 @@ services:
- mysql

harvester-api:
build: harvester/.
image: &harvester-app polkascan-harvester
image: polkascan/pre-harvester:milestone1
ports:
- '8000:8000'
volumes:
Expand All @@ -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
Expand All @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 9b6e10a

Please sign in to comment.