Skip to content

Commit 2a775d7

Browse files
author
Michael de Hoog
authored
Add single-container support with supervisord (#128)
1 parent 4d87a51 commit 2a775d7

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,19 @@ RUN go run build/ci.go install -static ./cmd/geth
3333
FROM golang:1.19
3434

3535
RUN apt-get update && \
36-
apt-get install -y jq curl && \
36+
apt-get install -y jq curl supervisor && \
3737
rm -rf /var/lib/apt/lists
38+
RUN mkdir -p /var/log/supervisor
3839

3940
WORKDIR /app
4041

4142
COPY --from=op /app/op-node/bin/op-node ./
4243
COPY --from=geth /app/build/bin/geth ./
44+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
4345
COPY geth-entrypoint .
4446
COPY op-node-entrypoint .
4547
COPY goerli ./goerli
4648
COPY sepolia ./sepolia
4749
COPY mainnet ./mainnet
50+
51+
CMD ["/usr/bin/supervisord"]

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ services:
7878
- $HOME/data/base:/data
7979
```
8080
81+
#### Running in single container with `supervisord`
82+
83+
If you'd like to run the node in a single container instead of `docker-compose`, you can use the `supervisord` entrypoint.
84+
This is useful for running the node in a Kubernetes cluster, for example.
85+
86+
Note that you'll need to override some of the default configuration that assumes a multi-container environment (`OP_NODE_L2_ENGINE_RPC`) and any port conflicts (`OP_NODE_RPC_PORT`).
87+
Example:
88+
```
89+
docker run --env-file .env.goerli -e OP_NODE_L2_ENGINE_RPC=ws://localhost:8551 -e OP_NODE_RPC_PORT=7545 ghcr.io/base-org/node:latest
90+
```
91+
8192
### Snapshots
8293

8394
If you're a prospective or current Base Node operator and would like to restore from a snapshot to save time on the initial sync, it's possible to always get the latest available snapshot of the Base chain on mainnet and/or testnet by using the following CLI commands. The snapshots are updated every hour.

supervisord.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[supervisord]
2+
nodaemon=true
3+
logfile=/dev/null
4+
logfile_maxbytes=0
5+
6+
[program:op-node]
7+
command=/app/op-node-entrypoint
8+
stdout_logfile=/dev/fd/1
9+
stdout_logfile_maxbytes=0
10+
redirect_stderr=true
11+
12+
[program:op-geth]
13+
command=/app/geth-entrypoint
14+
stdout_logfile=/dev/fd/1
15+
stdout_logfile_maxbytes=0
16+
redirect_stderr=true

0 commit comments

Comments
 (0)