Commit 57e45fea authored by Ivan Vandot's avatar Ivan Vandot Committed by GitHub

add support for docker-compose (#1033)

parent 99cf7b95
......@@ -19,10 +19,14 @@ RUN apt-get update && apt-get install -y \
groupadd -r bee --gid 999; \
useradd -r -g bee --uid 999 --no-log-init -m bee;
# make sure mounted volumes have correct permissions
RUN mkdir -p /home/bee/.bee && chown 999:999 /home/bee/.bee
COPY --from=build /src/dist/bee /usr/local/bin/bee
EXPOSE 1633 1634 1635
USER bee
WORKDIR /home/bee
VOLUME /home/bee/.bee
ENTRYPOINT ["bee"]
# Docker
The docker-compose provides an app container for bee itself and a signer container for Clef.
To prepare your machine to run docker compose execute
```
mkdir -p bee && cd bee
wget -q https://raw.githubusercontent.com/ethersphere/bee/master/packaging/docker/docker-compose.yml
wget -q https://raw.githubusercontent.com/ethersphere/bee/master/packaging/docker/env -O .env
```
Set all inside `.env`
To configure `clef` set:
- `CLEF_CHAINID=5` for goerli
To configure `bee` set:
- `BEE_CLEF_SIGNER_ENABLE=true` to enable clef support
- `BEE_CLEF_SIGNER_ENDPOINT=http://clef:8550`
- `BEE_SWAP_ENDPOINT=https://rpc.slock.it/goerli`
Set bee password by either setting `BEE_PASSWORD` or `BEE_PASSWORD_FILE`
If you want to use password file set it to
- `BEE_PASSWORD_FILE=/password`
Mount password file local file system by adding
```
- ./password:/password
```
to app volumes inside `docker-compose.yml`
Start it with
```
docker-compose up -d
```
From logs find URL line with `on goerli you can get both goerli eth and goerli bzz from` and prefund your node
```
docker-compose logs -f app
```
version: "3"
services:
signer:
image: ethersphere/clef:0.4.2
restart: unless-stopped
environment:
- CLEF_CHAINID
volumes:
- clef:/app/data
command: full
app:
image: ethersphere/bee:latest
restart: unless-stopped
environment:
- BEE_API_ADDR
- BEE_BOOTNODE
- BEE_CLEF_SIGNER_ENABLE
- BEE_CLEF_SIGNER_ENDPOINT
- BEE_CONFIG
- BEE_CORS_ALLOWED_ORIGINS
- BEE_DATA_DIR
- BEE_DB_CAPACITY
- BEE_DEBUG_API_ADDR
- BEE_DEBUG_API_ENABLE
- BEE_GATEWAY_MODE
- BEE_GLOBAL_PINNING_ENABLE
- BEE_NAT_ADDR
- BEE_NETWORK_ID
- BEE_P2P_ADDR
- BEE_P2P_QUIC_ENABLE
- BEE_P2P_WS_ENABLE
- BEE_PASSWORD
- BEE_PASSWORD_FILE
- BEE_PAYMENT_EARLY
- BEE_PAYMENT_THRESHOLD
- BEE_PAYMENT_TOLERANCE
- BEE_RESOLVER_OPTIONS
- BEE_STANDALONE
- BEE_SWAP_ENABLE
- BEE_SWAP_ENDPOINT
- BEE_SWAP_FACTORY_ADDRESS
- BEE_SWAP_INITIAL_DEPOSIT
- BEE_TRACING_ENABLE
- BEE_TRACING_ENDPOINT
- BEE_TRACING_SERVICE_NAME
- BEE_VERBOSITY
- BEE_WELCOME_MESSAGE
ports:
- "${API_ADDR:-1633}:${BEE_API_ADDR:-1633}"
- "${P2P_ADDR:-1634}:${BEE_P2P_ADDR:-1634}"
- "127.0.0.1:${DEBUG_API_ADDR:-1635}:${BEE_DEBUG_API_ADDR:-1635}"
volumes:
- bee:/home/bee/.bee
command: start
depends_on:
- signer
volumes:
clef:
bee:
# Copy this file to .env, then update it with your own settings
### CLEF
## chain id to use for signing (1=mainnet, 3=ropsten, 4=rinkeby, 5=goerli) (default: 12345)
# CLEF_CHAINID=12345
### BEE
## HTTP API listen address (default ":1633")
# BEE_API_ADDR=:1633
## initial nodes to connect to (default [/dnsaddr/bootnode.ethswarm.org])
# BEE_BOOTNODE=[/dnsaddr/bootnode.ethswarm.org]
## enable clef signer
# BEE_CLEF_SIGNER_ENABLE=false
## clef signer endpoint
# BEE_CLEF_SIGNER_ENDPOINT=""
## config file (default is /home/<user>/.bee.yaml)
# BEE_CONFIG=/home/bee/.bee.yaml
## origins with CORS headers enabled
# BEE_CORS_ALLOWED_ORIGINS=[]
## data directory (default "/home/<user>/.bee")
# BEE_DATA_DIR=/home/bee/.bee
## db capacity in chunks, multiply by 4096 to get approximate capacity in bytes
# BEE_DB_CAPACITY=5000000
## debug HTTP API listen address (default ":1635")
# BEE_DEBUG_API_ADDR=:1635
## enable debug HTTP API
# BEE_DEBUG_API_ENABLE=true
## disable a set of sensitive features in the api
# BEE_GATEWAY_MODE=false
## enable global pinning
# BEE_GLOBAL_PINNING_ENABLE=false
## NAT exposed address
# BEE_NAT_ADDR=""
## ID of the Swarm network (default 1)
# BEE_NETWORK_ID=1
## P2P listen address (default ":1644")
# BEE_P2P_ADDR=:1644
## enable P2P QUIC protocol
# BEE_P2P_QUIC_ENABLE=false
## enable P2P WebSocket transport
# BEE_P2P_WS_ENABLE=false
## password for decrypting keys
# BEE_PASSWORD=""
## path to a file that contains password for decrypting keys
# BEE_PASSWORD_FILE=""
## amount in BZZ below the peers payment threshold when we initiate settlement (default 10000)
# BEE_PAYMENT_EARLY=10000
## threshold in BZZ where you expect to get paid from your peers (default 100000)
# BEE_PAYMENT_THRESHOLD=100000
## excess debt above payment threshold in BZZ where you disconnect from your peer (default 10000)
# BEE_PAYMENT_TOLERANCE=10000
## ENS compatible API endpoint for a TLD and with contract address, can be repeated, format [tld:][contract-addr@]url
# BEE_RESOLVER_OPTIONS=[]
## whether we want the node to start with no listen addresses for p2p
# BEE_STANDALONE=false
## enable swap (default true)
# BEE_SWAP_ENABLE=true
## swap ethereum blockchain endpoint (default "http://localhost:8545")
# BEE_SWAP_ENDPOINT=http://localhost:8545
## swap factory address
# BEE_SWAP_FACTORY_ADDRESS=""
## initial deposit if deploying a new chequebook (default 100000000)
# BEE_SWAP_INITIAL_DEPOSIT=100000000
## enable tracing
# BEE_TRACING_ENABLE=false
## endpoint to send tracing data (default "127.0.0.1:6831")
# BEE_TRACING_ENDPOINT=127.0.0.1:6831
## service name identifier for tracing (default "bee")
# BEE_TRACING_SERVICE_NAME=bee
## log verbosity level 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=trace (default "info")
# BEE_VERBOSITY=info
## send a welcome message string during handshakes
# BEE_WELCOME_MESSAGE=""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment