Updated networking for exposing a web front end.

This commit is contained in:
chamunks 2018-10-09 14:33:47 -04:00
parent 33e8a9f098
commit a2e25cf667
14 changed files with 53 additions and 53 deletions

View file

@ -2,8 +2,8 @@ COMPOSE_PROJECT_NAME=chainquery
RPC_USER=${RPC_USER=lbryrpc} RPC_USER=${RPC_USER=lbryrpc}
RPC_PASSWORD=${RPC_PASSWORD:-changeme} RPC_PASSWORD=${RPC_PASSWORD:-changeme}
## This should be the internal container IP from which you'll be calling the RPC for Lbrycrdd from. ## This should be the internal container IP from which you'll be calling the RPC for Lbrycrdd from.
RPC_ALLOW_IP=${RPC_ALLOW_IP:-10.10.0.3} RPC_ALLOW_IP=${RPC_ALLOW_IP:-10.5.1.3}
MYSQL_SERVER=${MYSQL_SERVER:-10.10.0.10} MYSQL_SERVER=${MYSQL_SERVER:-10.5.1.10}
MYSQL_USER=${MYSQL_USER:-changeme} MYSQL_USER=${MYSQL_USER:-changeme}
MYSQL_PASSWORD=${MYSQL_PASSWORD:-changeme} MYSQL_PASSWORD=${MYSQL_PASSWORD:-changeme}
MYSQL_DATABASE=${MYSQL_DATABASE:-chainquery} MYSQL_DATABASE=${MYSQL_DATABASE:-chainquery}

View file

@ -2,13 +2,13 @@
debugmode=false debugmode=false
#LBRYcrd URL is required for chainquery to query the blockchain #LBRYcrd URL is required for chainquery to query the blockchain
lbrycrdurl="rpc://lbryrpc:changeme@10.10.0.3:9245" lbrycrdurl="rpc://lbryrpc:changeme@10.5.1.3:9245"
#MySQL DSN is required for chainquery to store information. #MySQL DSN is required for chainquery to store information.
mysqldsn="changeme:changeme@tcp(10.10.0.10:3306)/chainquery" mysqldsn="changeme:changeme@tcp(10.5.1.10:3306)/chainquery"
#API MySQL DSN is required for chainquery to expose a SQL query service #API MySQL DSN is required for chainquery to expose a SQL query service
apimysqldsn="changeme:changeme@tcp(10.10.0.10:3306)/chainquery" apimysqldsn="changeme:changeme@tcp(10.5.1.10:3306)/chainquery"
#The command that should be executed to trigger a self update of the software. For linux, for example, `<yourscript>.sh` #The command that should be executed to trigger a self update of the software. For linux, for example, `<yourscript>.sh`
#DEFAULT-autoupdatecommand=[unset] #DEFAULT-autoupdatecommand=[unset]

View file

@ -1,7 +1,7 @@
version: '3.4' version: '3.4'
networks: networks:
lbrynet: traefik:
external: true external: true
services: services:
@ -14,14 +14,14 @@ services:
image: mysql:5.7.23 image: mysql:5.7.23
restart: always restart: always
networks: networks:
lbrynet: traefik:
ipv4_address: 10.10.0.10 ipv4_address: 10.5.1.10
aliases: aliases:
- mysql - mysql
environment: environment:
## These variables are stored in the .env file next to this docker-compose.yml file. ## These variables are stored in the .env file next to this docker-compose.yml file.
## I will include a default .env file and .gitignore the ".env" pattern so you should be able to just git pull in the future if you need to. ## I will include a default .env file and .gitignore the ".env" pattern so you should be able to just git pull in the future if you need to.
MYSQL_SERVER: ${MYSQL_SERVER:-10.10.0.10} MYSQL_SERVER: ${MYSQL_SERVER:-10.5.1.10}
MYSQL_USER: ${MYSQL_USER:-changeme} MYSQL_USER: ${MYSQL_USER:-changeme}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-changeme} MYSQL_PASSWORD: ${MYSQL_PASSWORD:-changeme}
MYSQL_DATABASE: ${MYSQL_DATABASE:-chainquery} MYSQL_DATABASE: ${MYSQL_DATABASE:-chainquery}
@ -52,8 +52,8 @@ services:
# healthcheck: # healthcheck:
# test: ["CMD", "curl", "--fail", "http://localhost:8080/", "||", "exit", "1"] # test: ["CMD", "curl", "--fail", "http://localhost:8080/", "||", "exit", "1"]
networks: networks:
lbrynet: traefik:
ipv4_address: 10.10.0.19 ipv4_address: 10.5.1.19
aliases: aliases:
- adminer - adminer
@ -64,8 +64,8 @@ services:
build: . build: .
restart: always restart: always
networks: networks:
lbrynet: traefik:
ipv4_address: 10.10.0.2 ipv4_address: 10.5.1.2
labels: labels:
- "traefik.expose=false" - "traefik.expose=false"
expose: expose:

View file

@ -2,4 +2,4 @@ COMPOSE_PROJECT_NAME=lbrycrd
RPC_USER=${RPC_USER=lbryrpc} RPC_USER=${RPC_USER=lbryrpc}
RPC_PASSWORD=${RPC_PASSWORD:-changeme} RPC_PASSWORD=${RPC_PASSWORD:-changeme}
## This should be the internal container IP from which you'll be calling the RPC for Lbrycrdd from. ## This should be the internal container IP from which you'll be calling the RPC for Lbrycrdd from.
RPC_ALLOW_IP=${RPC_ALLOW_IP:-10.10.0.2} RPC_ALLOW_IP=${RPC_ALLOW_IP:-10.5.1.2}

View file

@ -1,7 +1,7 @@
version: '3.4' version: '3.4'
networks: networks:
lbrynet: traefik:
external: true external: true
services: services:
@ -12,8 +12,8 @@ services:
build: . build: .
restart: always restart: always
networks: networks:
lbrynet: traefik:
ipv4_address: 10.10.0.3 ipv4_address: 10.5.1.3
labels: labels:
- "traefik.expose=false" - "traefik.expose=false"
user: "${UID:-1000}:${GID:-1000}" user: "${UID:-1000}:${GID:-1000}"

View file

@ -24,7 +24,7 @@
# # -rpcport=${RPC_PORT:-9245} \ # # -rpcport=${RPC_PORT:-9245} \
# # -rpcpassword=${RPC_PASSWORD:-changeme} \ # # -rpcpassword=${RPC_PASSWORD:-changeme} \
# # -rpcuser=${RPC_USER:-lbryrpc} \ # # -rpcuser=${RPC_USER:-lbryrpc} \
# # -rpcallowip=${RPC_ALLOW_IP:-10.10.0.2} \ # # -rpcallowip=${RPC_ALLOW_IP:-10.5.1.2} \
# # -reindex \ # # -reindex \
# # -txindex # # -txindex
# #
@ -38,7 +38,7 @@
# -rpcport=${RPC_PORT:-9245} \ # -rpcport=${RPC_PORT:-9245} \
# -rpcpassword=${RPC_PASSWORD:-changeme} \ # -rpcpassword=${RPC_PASSWORD:-changeme} \
# -rpcuser=${RPC_USER:-lbryrpc} \ # -rpcuser=${RPC_USER:-lbryrpc} \
# -rpcallowip=${RPC_ALLOW_IP:-10.10.0.2} \ # -rpcallowip=${RPC_ALLOW_IP:-10.5.1.2} \
# -txindex # -txindex
#!/bin/bash #!/bin/bash
@ -52,7 +52,7 @@ mkdir -p ~/.lbrycrd
## Set config params ## Set config params
echo -e "rpcuser=lbryrpc\nrpcpassword=${RPC_PASSWORD:-changeme}" > ~/.lbrycrd/lbrycrd.conf echo -e "rpcuser=lbryrpc\nrpcpassword=${RPC_PASSWORD:-changeme}" > ~/.lbrycrd/lbrycrd.conf
echo -e "rpcallowip=${RPC_ALLOW_IP:-10.10.0.2}" >> ~/.lbrycrd/lbrycrd.conf echo -e "rpcallowip=${RPC_ALLOW_IP:-10.5.1.2}" >> ~/.lbrycrd/lbrycrd.conf
echo -e "rpcuser=${RPC_USER:-lbryrpc}" >> ~/.lbrycrd/lbrycrd.conf echo -e "rpcuser=${RPC_USER:-lbryrpc}" >> ~/.lbrycrd/lbrycrd.conf
## For now keeping this simple. Potentially eventually add all command args as envvars for the Dockerfile or use safe way to add args via docker-compose.yml ## For now keeping this simple. Potentially eventually add all command args as envvars for the Dockerfile or use safe way to add args via docker-compose.yml
@ -70,4 +70,4 @@ lbrycrdd \
# -rpcport=${RPC_PORT:-9245} \ # -rpcport=${RPC_PORT:-9245} \
# -rpcpassword=${RPC_PASSWORD:-changeme} \ # -rpcpassword=${RPC_PASSWORD:-changeme} \
# -rpcuser=${RPC_USER:-lbryrpc} \ # -rpcuser=${RPC_USER:-lbryrpc} \
# -rpcallowip=${RPC_ALLOW_IP:-10.10.0.2} # -rpcallowip=${RPC_ALLOW_IP:-10.5.1.2}

View file

@ -10,7 +10,7 @@ RUN adduser lbrynet --gecos GECOS --shell /bin/bash/ --disabled-password --home
ADD https://lbry.io/get/lbrynet.linux.zip /data/lbrynet.linux.zip ADD https://lbry.io/get/lbrynet.linux.zip /data/lbrynet.linux.zip
RUN unzip /data/lbrynet.linux.zip -d /data/ && \ RUN unzip /data/lbrynet.linux.zip -d /data/ && \
rm /data/lbrynet.linux.zip && \ rm /data/lbrynet.linux.zip && \
chown -Rv lbrynet:lbrynet /data chown -Rv traefik:lbrynet /data
RUN wget -quiet -O /usr/bin/debugpaste https://github.com/nixc-us/debugpaste-it/raw/master/bin/debugpaste_64 && \ RUN wget -quiet -O /usr/bin/debugpaste https://github.com/nixc-us/debugpaste-it/raw/master/bin/debugpaste_64 && \
chmod +x /usr/bin/debugpaste chmod +x /usr/bin/debugpaste

View file

@ -1,19 +1,19 @@
version: '3.4' version: '3.4'
networks: networks:
lbrynet: traefik:
external: true external: true
services: services:
############# #############
## Lbrynet ## ## Lbrynet ##
############# #############
lbrynet: traefik:
build: . build: .
restart: always restart: always
networks: networks:
lbrynet: traefik:
ipv4_address: 10.10.0.4 ipv4_address: 10.5.1.4
labels: labels:
- "traefik.expose=false" - "traefik.expose=false"
ports: ports:

View file

@ -1,7 +1,7 @@
version: '3.4' version: '3.4'
networks: networks:
lbrynet: traefik:
external: true external: true
services: services:
@ -14,14 +14,14 @@ services:
image: mysql.5.7.23 image: mysql.5.7.23
restart: always restart: always
networks: networks:
lbrynet: traefik:
ipv4_address: 10.10.0.11 ipv4_address: 10.5.1.11
aliases: aliases:
- mysql - mysql
environment: environment:
## These variables are stored in the .env file next to this docker-compose.yml file. ## These variables are stored in the .env file next to this docker-compose.yml file.
## I will include a default .env file and .gitignore the ".env" pattern so you should be able to just git pull in the future if you need to. ## I will include a default .env file and .gitignore the ".env" pattern so you should be able to just git pull in the future if you need to.
MYSQL_SERVER: ${MYSQL_SERVER:-10.10.0.11} MYSQL_SERVER: ${MYSQL_SERVER:-10.5.1.11}
MYSQL_USER: ${MYSQL_USER:-changeme} MYSQL_USER: ${MYSQL_USER:-changeme}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-changeme} MYSQL_PASSWORD: ${MYSQL_PASSWORD:-changeme}
MYSQL_DATABASE: ${MYSQL_DATABASE:-reflector} MYSQL_DATABASE: ${MYSQL_DATABASE:-reflector}
@ -38,8 +38,8 @@ services:
build: . build: .
restart: always restart: always
networks: networks:
lbrynet: traefik:
ipv4_address: 10.10.0.20 ipv4_address: 10.5.1.20
environment: environment:
AWS_ID: ${AWS_ID:-default} AWS_ID: ${AWS_ID:-default}
AWS_SECRET: ${AWS_SECRET:-default} AWS_SECRET: ${AWS_SECRET:-default}
@ -47,7 +47,7 @@ services:
BUCKET_NAME: ${BUCKET_NAME:-default} BUCKET_NAME: ${BUCKET_NAME:-default}
DB_USER: ${MYSQL_USER:-changeme} DB_USER: ${MYSQL_USER:-changeme}
DB_PASSWORD: ${MYSQL_PASSWORD:-changeme} DB_PASSWORD: ${MYSQL_PASSWORD:-changeme}
DB_HOSTIP: ${MYSQL_SERVER:-10.10.0.11} DB_HOSTIP: ${MYSQL_SERVER:-10.5.1.11}
DB_PORT: ${DB_PORT:-3306} DB_PORT: ${DB_PORT:-3306}
DB_NAME: ${MYSQL_DATABASE:-reflector} DB_NAME: ${MYSQL_DATABASE:-reflector}
labels: labels:

View file

@ -1,7 +1,7 @@
version: '3.4' version: '3.4'
networks: networks:
lbrynet: traefik:
external: true external: true
services: services:
@ -14,8 +14,8 @@ services:
image: traefik:alpine image: traefik:alpine
command: --api --docker --docker.domain=docker.localhost --logLevel=DEBUG command: --api --docker --docker.domain=docker.localhost --logLevel=DEBUG
networks: networks:
lbrynet: traefik:
ipv4_address: 10.10.0.100 ipv4_address: 10.5.1.100
ports: ports:
- target: 80 - target: 80
published: 80 published: 80

View file

@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
docker network create -d bridge --subnet=10.10.0.0/16 lbrynet docker network create -d bridge --subnet=10.5.1.0/16 lbrynet

View file

@ -1,6 +1,6 @@
COMPOSE_PROJECT_NAME=speech COMPOSE_PROJECT_NAME=speech
## This value can generally be left alone in a default setup. ## This value can generally be left alone in a default setup.
MYSQL_SERVER=10.10.0.8 MYSQL_SERVER=10.5.1.8
## Update the rest of these if possible. ## Update the rest of these if possible.
MYSQL_USER=replaceme MYSQL_USER=replaceme
MYSQL_PASSWORD=REPLACEME MYSQL_PASSWORD=REPLACEME

View file

@ -23,14 +23,14 @@ services:
- "traefik.port=3000" - "traefik.port=3000"
networks: networks:
green: green:
ipv4_address: 10.10.0.6 ipv4_address: 10.5.1.6
aliases: aliases:
- speech - speech
############# #############
## Lbrynet ## ## Lbrynet ##
############# #############
lbrynet: traefik:
build: build:
context: ../lbrynet-daemon/ context: ../lbrynet-daemon/
dockerfile: Dockerfile dockerfile: Dockerfile
@ -40,12 +40,12 @@ services:
- 50001 - 50001
## host volumes for persistent data such as wallet private keys. ## host volumes for persistent data such as wallet private keys.
volumes: volumes:
- ../data/lbrynet:/data - ../data/traefik:/data
labels: labels:
test: traefik.enable=false test: traefik.enable=false
networks: networks:
green: green:
ipv4_address: 10.10.0.7 ipv4_address: 10.5.1.7
aliases: aliases:
- lbrynet - lbrynet
@ -57,7 +57,7 @@ services:
image: mariadb image: mariadb
# restart: always # restart: always
environment: environment:
MYSQL_SERVER: 10.10.0.8 MYSQL_SERVER: 10.5.1.8
MYSQL_USER: replaceme MYSQL_USER: replaceme
MYSQL_PASSWORD: REPLACEME MYSQL_PASSWORD: REPLACEME
MYSQL_DATABASE: speech MYSQL_DATABASE: speech
@ -70,7 +70,7 @@ services:
test: traefik.enable=false test: traefik.enable=false
networks: networks:
green: green:
ipv4_address: 10.10.0.8 ipv4_address: 10.5.1.8
aliases: aliases:
- mysql - mysql
@ -95,7 +95,7 @@ services:
# test: ["CMD", "curl", "--fail", "http://localhost:8080/", "||", "exit", "1"] # test: ["CMD", "curl", "--fail", "http://localhost:8080/", "||", "exit", "1"]
networks: networks:
green: green:
ipv4_address: 10.10.0.9 ipv4_address: 10.5.1.9
aliases: aliases:
- adminer - adminer
@ -139,7 +139,7 @@ services:
retries: 3 retries: 3
networks: networks:
green: green:
ipv4_address: 10.10.0.10 ipv4_address: 10.5.1.10
aliases: aliases:
- traefik - traefik
@ -151,4 +151,4 @@ networks:
driver: bridge driver: bridge
ipam: ipam:
config: config:
- subnet: 10.10.0.0/16 - subnet: 10.5.1.0/16

View file

@ -19,14 +19,14 @@ services:
- ./data/speech:/data - ./data/speech:/data
networks: networks:
green: green:
ipv4_address: 10.10.0.6 ipv4_address: 10.5.1.6
aliases: aliases:
- speech - speech
############# #############
## Lbrynet ## ## Lbrynet ##
############# #############
lbrynet: traefik:
build: build:
context: ../lbrynet-daemon/ context: ../lbrynet-daemon/
dockerfile: Dockerfile dockerfile: Dockerfile
@ -44,10 +44,10 @@ services:
- 50001:50001 - 50001:50001
## host volumes for persistent data such as wallet private keys. ## host volumes for persistent data such as wallet private keys.
volumes: volumes:
- ./data/lbrynet:/data - ./data/traefik:/data
networks: networks:
green: green:
ipv4_address: 10.10.0.7 ipv4_address: 10.5.1.7
aliases: aliases:
- lbrynet - lbrynet
@ -74,7 +74,7 @@ services:
- ./data/db:/var/lib/mysql - ./data/db:/var/lib/mysql
networks: networks:
green: green:
ipv4_address: 10.10.0.8 ipv4_address: 10.5.1.8
aliases: aliases:
- mysql - mysql
@ -86,4 +86,4 @@ networks:
driver: bridge driver: bridge
ipam: ipam:
config: config:
- subnet: 10.10.0.0/16 - subnet: 10.5.1.0/16