Skip to content

Instantly share code, notes, and snippets.

@igorbarinov
Last active January 28, 2020 18:13
Show Gist options
  • Save igorbarinov/500513ecefc4d6bd8534a91d622ea915 to your computer and use it in GitHub Desktop.
Save igorbarinov/500513ecefc4d6bd8534a91d622ea915 to your computer and use it in GitHub Desktop.
version: '3.7'
services:
parity:
init: true
container_name: parity
image: parity/parity:stable
user: root
command:
--reserved-peers=/root/bootnodes.txt
--tracing=on
--pruning=archive
--fat-db=on
--no-warp
--chain="$CHAIN"
--nat="extip:$EXT_IP"
--base-path=/root/parity_data
--jsonrpc-port=8545
--jsonrpc-cors=all
--jsonrpc-interface=all
--jsonrpc-hosts=all
--jsonrpc-apis=web3,eth,net,parity,traces
--ws-interface=all
--ws-apis=web3,eth,net,parity,pubsub,traces
--ws-origins=all
--ws-hosts=all
--ws-max-connections=1000
--logging=info
volumes:
- ./:/root
expose:
- "8545"
ports:
- "8546:8546"
- "30303:30303"
- "30303:30303/udp"
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "10"
db:
init: true
container_name: db
image: postgres
command: postgres -c 'max_connections=200'
environment:
- POSTGRES_USER=$POSTGRES_USER
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
- POSTGRES_DB=$POSTGRES_DB
volumes:
- ./db_data:/var/lib/postgresql/data/
expose:
- 5432
ports:
- "5432:5432"
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "10"
blockscout:
init: true
container_name: blockscout
image: blockscout/blockscout-lukso:3.0.0
environment:
VIRTUAL_HOST: "$LETSENCRYPT_HOST"
VIRTUAL_PORT: 4000
LETSENCRYPT_HOST: "$LETSENCRYPT_HOST"
env_file:
- blockscout.env
depends_on:
- db
restart: unless-stopped
expose:
- "4000"
ports:
- "4000:4000"
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "10"
nginx:
init: true
image: nginx:alpine
container_name: nginx
restart: always
ports:
- 80:80
- 443:443
volumes:
- ./nginx/conf:/etc/nginx/conf.d
- ./nginx/vhost:/etc/nginx/vhost.d
- ./nginx/html:/usr/share/nginx/html
- ./nginx/certs:/etc/nginx/certs:ro
logging:
driver: none
options:
max-size: "1m"
max-file: "10"
dockergen:
init: true
image: xdaichain/docker-gen
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
container_name: dockergen
depends_on:
- nginx
volumes:
- ./nginx/conf:/etc/nginx/conf.d
- ./nginx/vhost:/etc/nginx/vhost.d
- ./nginx/certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: always
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "10"
letsencrypt:
init: true
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt
restart: always
environment:
NGINX_PROXY_CONTAINER: nginx
NGINX_DOCKER_GEN_CONTAINER: dockergen
volumes:
- ./nginx/vhost:/etc/nginx/vhost.d
- ./nginx/html:/usr/share/nginx/html
- ./nginx/certs:/etc/nginx/certs
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- nginx
- dockergen
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "10"
@igorbarinov
Copy link
Author

blockscout.env

DATABASE_URL=postgresql://user:password@db:5432/lukso?ssl=false
ETHEREUM_JSONRPC_HTTP_URL=http://parity:8545
ETHEREUM_JSONRPC_TRACE_URL=http://parity:8545
ETHEREUM_JSONRPC_WS_URL=ws://parity:8546
SECRET_KEY_BASE='secret'

.env file

POSTGRES_USER=user
POSTGRES_PASSWORD=password
POSTGRES_DB=lukso
CHAIN=/root/spec.json
EXT_IP=167.71.61.205
LETSENCRYPT_HOST=blockscout-lukso.blockscout.com

@igorbarinov
Copy link
Author

regarding DB:

  1. close postgres port on firewall
  2. to import dump pg_restore --host localhost --port 5432 -U lukso --verbose --format d -d lukso ./backup/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment