Update docker compose yaml (#259)

* Use sqlite for squeak node in docker compose

* Include other sqkserver in docker docker-compose

* Use second instance of squeak node in docker compose

* Remove old log line
This commit is contained in:
Jonathan Zernik 2020-09-27 14:54:34 -07:00 committed by GitHub
parent 8d1bb513ac
commit 9aef37bd71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 103 additions and 19 deletions

View file

@ -2,8 +2,9 @@
network=testnet
price=1000
max_squeaks_per_address_per_hour=100
database=postgresql
database=sqlite
sqk_dir=
enable_sync=true
[lnd]
host=lnd

View file

@ -1,17 +1,6 @@
version: '3'
services:
db:
image: postgres
container_name: db
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- postgres_dir:/var/lib/postgresql/data
- ../createdb.sql:/docker-entrypoint-initdb.d/init.sql
btcd:
image: btcd
container_name: btcd
@ -39,6 +28,26 @@ services:
- lnd_dir:/root/.lnd
links:
- "btcd:btcd"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
entrypoint: ["./start-lnd.sh"]
lnd_other:
image: lnd_other
container_name: lnd_other
build:
context: ../
dockerfile: docker/lnd/Dockerfile
environment:
- NETWORK=testnet
- RPCHOST=btcd
volumes:
- shared:/rpc
- lnd_other_dir:/root/.lnd
links:
- "btcd:btcd"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
entrypoint: ["./start-lnd.sh"]
sqkserver:
@ -56,8 +65,23 @@ services:
links:
- "btcd:btcd"
- "lnd:lnd"
depends_on:
- db
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
entrypoint: ["./start-sqkserver.sh"]
sqkserver_other:
image: sqkserver_other
container_name: sqkserver_other
build:
context: ../
dockerfile: docker/sqkserver/Dockerfile
volumes:
- shared:/rpc
- lnd_other_dir:/root/.lnd
- ./config.ini:/app/config.ini
links:
- "btcd:btcd"
- "lnd_other:lnd"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
entrypoint: ["./start-sqkserver.sh"]
@ -72,6 +96,21 @@ services:
- 8080:8080
links:
- "sqkserver:sqkserver"
environment:
- SERVICE_NAME=sqkserver
envoy_other:
image: envoy_other
container_name: envoy_other
build:
context: ../
dockerfile: docker/envoy/Dockerfile
ports:
- 8090:8080
links:
- "sqkserver_other:sqkserver_other"
environment:
- SERVICE_NAME=sqkserver_other
frontend:
image: frontend
@ -79,9 +118,22 @@ services:
build:
context: ../
dockerfile: docker/frontend/Dockerfile
args:
- PORT=8080
ports:
- 8081:8081
frontend_other:
image: frontend_other
container_name: frontend_other
build:
context: ../
dockerfile: docker/frontend/Dockerfile
args:
- PORT=8090
ports:
- 8091:8081
volumes:
bitcoin:
driver: local
@ -94,5 +146,9 @@ volumes:
lnd_dir:
driver: local
# lnd_other_dir volume is needed for sharing the lnd tls certificate
lnd_other_dir:
driver: local
postgres_dir:
driver: local

View file

@ -14,7 +14,18 @@
FROM envoyproxy/envoy:v1.15.0
# COPY "docker/envoy/envoy.yaml" /etc/envoy/envoy.yaml
COPY "frontend/envoy.yaml" /etc/envoy/envoy.yaml
#COPY "frontend/envoy.yaml" /etc/envoy/envoy.yaml
CMD /usr/local/bin/envoy -c /etc/envoy/envoy.yaml -l trace --log-path /tmp/envoy_info.log
#CMD /usr/local/bin/envoy -c /etc/envoy/envoy.yaml -l trace --log-path /tmp/envoy_info.log
COPY "frontend/envoy.yaml" /tmpl/envoy.yaml.tmpl
COPY docker/envoy/docker-entrypoint.sh /
RUN chmod 500 /docker-entrypoint.sh
RUN apt-get update && \
apt-get install gettext -y
ENTRYPOINT ["/docker-entrypoint.sh"]

View file

@ -0,0 +1,8 @@
#!/bin/sh
set -e
echo "Generating envoy.yaml config file..."
cat /tmpl/envoy.yaml.tmpl | envsubst \$ENVOY_LB_ALG,\$SERVICE_NAME > /etc/envoy.yaml
echo "Starting Envoy..."
/usr/local/bin/envoy -c /etc/envoy.yaml

View file

@ -1,5 +1,7 @@
FROM node:10-stretch
ARG PORT
RUN apt-get -qq update && apt-get -qq install -y \
unzip
@ -32,6 +34,7 @@ RUN chmod +x pb_disable-eslint.sh && \
./pb_disable-eslint.sh src/proto/
RUN npm install && \
REACT_APP_PORT=${PORT} \
npm run build
EXPOSE 8081

View file

@ -50,5 +50,5 @@ static_resources:
- endpoint:
address:
socket_address:
address: sqkserver
address: ${SERVICE_NAME}
port_value: 8994

View file

@ -1,3 +1,8 @@
import { SqueakAdminClient } from "../proto/squeak_admin_grpc_web_pb"
export let client = new SqueakAdminClient('http://' + window.location.hostname + ':8080')
const PORT = process.env.REACT_APP_PORT;
console.log("port:");
console.log(PORT);
export let client = new SqueakAdminClient('http://' + window.location.hostname + ':' + PORT)