Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: more secure PG env vars and ports cleanup #5763

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ docker run -it \
The Docker Compose setup requires an Ethereum network name and node
to connect to. By default, it will use `mainnet:http://host.docker.internal:8545`
in order to connect to an Ethereum node running on your host machine.
You can replace this with anything else in `docker-compose.yaml`.
You can replace this with anything else in `docker-compose.yaml` or set the
environment variables `NETWORK_NAME` and `ETHEREUM_RPC_URL`.

After you have set up an Ethereum node—e.g. Ganache or Parity—simply
clone this repository and run
Expand Down
14 changes: 5 additions & 9 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@ services:
- '8000:8000'
- '8001:8001'
- '8020:8020'
- '8030:8030'
- '8040:8040'
depends_on:
- ipfs
- postgres
extra_hosts:
- host.docker.internal:host-gateway
environment:
postgres_host: postgres
postgres_user: graph-node
postgres_pass: let-me-in
postgres_user: ${POSTGRES_USER:-graph-node}
postgres_pass: ${POSTGRESS_PASSWORD:-let-me-in}
postgres_db: graph-node
ipfs: 'ipfs:5001'
ethereum: 'mainnet:http://host.docker.internal:8545'
ethereum: ${NETWORK_NAME:-mainnet}:${ETHEREUM_RPC_URL:-http://host.docker.internal:8545}
GRAPH_LOG: info
ipfs:
image: ipfs/kubo:v0.17.0
Expand All @@ -29,17 +27,15 @@ services:
- ./data/ipfs:/data/ipfs:Z
postgres:
image: postgres
ports:
- '5432:5432'
command:
[
"postgres",
"-cshared_preload_libraries=pg_stat_statements",
"-cmax_connections=200"
]
environment:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_USER: ${POSTGRES_USER:-graph-node}
POSTGRES_PASSWORD: ${POSTGRESS_PASSWORD:-let-me-in}
POSTGRES_DB: graph-node
# FIXME: remove this env. var. which we shouldn't need. Introduced by
# <https://github.com/graphprotocol/graph-node/pull/3511>, maybe as a
Expand Down