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_PASSWORD=${RPC_PASSWORD:-changeme}
## 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}
MYSQL_SERVER=${MYSQL_SERVER:-10.10.0.10}
RPC_ALLOW_IP=${RPC_ALLOW_IP:-10.5.1.3}
MYSQL_SERVER=${MYSQL_SERVER:-10.5.1.10}
MYSQL_USER=${MYSQL_USER:-changeme}
MYSQL_PASSWORD=${MYSQL_PASSWORD:-changeme}
MYSQL_DATABASE=${MYSQL_DATABASE:-chainquery}

View file

@ -2,13 +2,13 @@
debugmode=false
#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.
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
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`
#DEFAULT-autoupdatecommand=[unset]

View file

@ -1,7 +1,7 @@
version: '3.4'
networks:
lbrynet:
traefik:
external: true
services:
@ -14,14 +14,14 @@ services:
image: mysql:5.7.23
restart: always
networks:
lbrynet:
ipv4_address: 10.10.0.10
traefik:
ipv4_address: 10.5.1.10
aliases:
- mysql
environment:
## 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.
MYSQL_SERVER: ${MYSQL_SERVER:-10.10.0.10}
MYSQL_SERVER: ${MYSQL_SERVER:-10.5.1.10}
MYSQL_USER: ${MYSQL_USER:-changeme}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-changeme}
MYSQL_DATABASE: ${MYSQL_DATABASE:-chainquery}
@ -52,8 +52,8 @@ services:
# healthcheck:
# test: ["CMD", "curl", "--fail", "http://localhost:8080/", "||", "exit", "1"]
networks:
lbrynet:
ipv4_address: 10.10.0.19
traefik:
ipv4_address: 10.5.1.19
aliases:
- adminer
@ -64,8 +64,8 @@ services:
build: .
restart: always
networks:
lbrynet:
ipv4_address: 10.10.0.2
traefik:
ipv4_address: 10.5.1.2
labels:
- "traefik.expose=false"
expose:

View file

@ -2,4 +2,4 @@ COMPOSE_PROJECT_NAME=lbrycrd
RPC_USER=${RPC_USER=lbryrpc}
RPC_PASSWORD=${RPC_PASSWORD:-changeme}
## 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'
networks:
lbrynet:
traefik:
external: true
services:
@ -12,8 +12,8 @@ services:
build: .
restart: always
networks:
lbrynet:
ipv4_address: 10.10.0.3
traefik:
ipv4_address: 10.5.1.3
labels:
- "traefik.expose=false"
user: "${UID:-1000}:${GID:-1000}"

View file

@ -24,7 +24,7 @@
# # -rpcport=${RPC_PORT:-9245} \
# # -rpcpassword=${RPC_PASSWORD:-changeme} \
# # -rpcuser=${RPC_USER:-lbryrpc} \
# # -rpcallowip=${RPC_ALLOW_IP:-10.10.0.2} \
# # -rpcallowip=${RPC_ALLOW_IP:-10.5.1.2} \
# # -reindex \
# # -txindex
#
@ -38,7 +38,7 @@
# -rpcport=${RPC_PORT:-9245} \
# -rpcpassword=${RPC_PASSWORD:-changeme} \
# -rpcuser=${RPC_USER:-lbryrpc} \
# -rpcallowip=${RPC_ALLOW_IP:-10.10.0.2} \
# -rpcallowip=${RPC_ALLOW_IP:-10.5.1.2} \
# -txindex
#!/bin/bash
@ -52,7 +52,7 @@ mkdir -p ~/.lbrycrd
## Set config params
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
## 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} \
# -rpcpassword=${RPC_PASSWORD:-changeme} \
# -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
RUN unzip /data/lbrynet.linux.zip -d /data/ && \
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 && \
chmod +x /usr/bin/debugpaste

View file

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

View file

@ -1,7 +1,7 @@
version: '3.4'
networks:
lbrynet:
traefik:
external: true
services:
@ -14,14 +14,14 @@ services:
image: mysql.5.7.23
restart: always
networks:
lbrynet:
ipv4_address: 10.10.0.11
traefik:
ipv4_address: 10.5.1.11
aliases:
- mysql
environment:
## 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.
MYSQL_SERVER: ${MYSQL_SERVER:-10.10.0.11}
MYSQL_SERVER: ${MYSQL_SERVER:-10.5.1.11}
MYSQL_USER: ${MYSQL_USER:-changeme}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-changeme}
MYSQL_DATABASE: ${MYSQL_DATABASE:-reflector}
@ -38,8 +38,8 @@ services:
build: .
restart: always
networks:
lbrynet:
ipv4_address: 10.10.0.20
traefik:
ipv4_address: 10.5.1.20
environment:
AWS_ID: ${AWS_ID:-default}
AWS_SECRET: ${AWS_SECRET:-default}
@ -47,7 +47,7 @@ services:
BUCKET_NAME: ${BUCKET_NAME:-default}
DB_USER: ${MYSQL_USER:-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_NAME: ${MYSQL_DATABASE:-reflector}
labels:

View file

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

View file

@ -1,2 +1,2 @@
#!/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
## 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.
MYSQL_USER=replaceme
MYSQL_PASSWORD=REPLACEME

View file

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

View file

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