WIP: Feature/6/jeffreypicard/dockerize for deployment #7
4 changed files with 24 additions and 31 deletions
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
ARG ARCH=amd64
|
ARG ARCH=amd64
|
||||||
|
|
||||||
FROM golang:1.16-alpine3.14 AS build-container
|
FROM golang:1.17-buster AS build-container
|
||||||
|
|
||||||
ARG ARCH
|
ARG ARCH
|
||||||
ENV GO111MODULE=on
|
ENV GO111MODULE=on
|
||||||
|
@ -37,4 +37,4 @@ VOLUME ["/root/.lbcd"]
|
||||||
|
|
||||||
EXPOSE 9245 9246
|
EXPOSE 9245 9246
|
||||||
|
|
||||||
ENTRYPOINT ["lbcd"]
|
ENTRYPOINT ["/app/run.sh"]
|
||||||
|
|
29
config.go
29
config.go
|
@ -956,35 +956,6 @@ func loadConfig() (*config, []string, error) {
|
||||||
cfg.RPCListeners = normalizeAddresses(cfg.RPCListeners,
|
cfg.RPCListeners = normalizeAddresses(cfg.RPCListeners,
|
||||||
activeNetParams.rpcPort)
|
activeNetParams.rpcPort)
|
||||||
|
|
||||||
// Only allow TLS to be disabled if the RPC is bound to localhost
|
|
||||||
// addresses.
|
|
||||||
if !cfg.DisableRPC && cfg.DisableTLS {
|
|
||||||
allowedTLSListeners := map[string]struct{}{
|
|
||||||
"localhost": {},
|
|
||||||
"127.0.0.1": {},
|
|
||||||
"::1": {},
|
|
||||||
}
|
|
||||||
for _, addr := range cfg.RPCListeners {
|
|
||||||
host, _, err := net.SplitHostPort(addr)
|
|
||||||
if err != nil {
|
|
||||||
str := "%s: RPC listen interface '%s' is " +
|
|
||||||
"invalid: %v"
|
|
||||||
err := fmt.Errorf(str, funcName, addr, err)
|
|
||||||
fmt.Fprintln(os.Stderr, err)
|
|
||||||
fmt.Fprintln(os.Stderr, usageMessage)
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
if _, ok := allowedTLSListeners[host]; !ok {
|
|
||||||
str := "%s: the --notls option may not be used " +
|
|
||||||
"when binding RPC to non localhost " +
|
|
||||||
"addresses: %s"
|
|
||||||
err := fmt.Errorf(str, funcName, addr)
|
|
||||||
fmt.Fprintln(os.Stderr, err)
|
|
||||||
fmt.Fprintln(os.Stderr, usageMessage)
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add default port to all added peer addresses if needed and remove
|
// Add default port to all added peer addresses if needed and remove
|
||||||
// duplicate addresses.
|
// duplicate addresses.
|
||||||
|
|
20
docker-compose.yml
Normal file
20
docker-compose.yml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
lbcd:
|
||||||
|
|
||||||
|
services:
|
||||||
|
lbcd:
|
||||||
|
image: jeffreypicard/lbcd:deployment
|
||||||
|
container_name: lbcd
|
||||||
|
environment:
|
||||||
|
- LISTEN_ADDR= # Set me
|
||||||
|
ulimits:
|
||||||
|
memlock:
|
||||||
|
soft: -1
|
||||||
|
hard: -1
|
||||||
|
volumes:
|
||||||
|
- lbcd:/root/.lbcd
|
||||||
|
ports:
|
||||||
|
- "9245:9245"
|
||||||
|
- "9246:9246"
|
2
run.sh
Executable file
2
run.sh
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
lbcd --txindex --notls --rpcuser=lbry --rpcpass=lbry --rpclisten=$LISTEN_ADDR:9245
|
Loading…
Reference in a new issue