From 04cd459201d69e5df8143b05cc1cad169f25b781 Mon Sep 17 00:00:00 2001 From: Filippo Costa Date: Mon, 19 Sep 2022 16:26:33 +0200 Subject: [PATCH 1/2] docker: ship envsubst with the image --- docker/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 16a38350702..d15c8f4f808 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,6 +4,14 @@ # by running something like the following # docker build --target STAGE -f docker/Dockerfile . +FROM golang:buster as envsubst + +# v1.2.0 +ARG ENVSUBST_COMMIT_SHA=16035fe3571ad42c7796bf554f978bb2df64231b + +RUN go install github.com/a8m/envsubst/cmd/envsubst@$ENVSUBST_COMMIT_SHA \ + && strip -g /go/bin/envsubst + FROM rust:buster as graph-node-build ARG COMMIT_SHA=unknown @@ -88,5 +96,6 @@ RUN apt-get update \ ADD docker/wait_for docker/start /usr/local/bin/ COPY --from=graph-node-build /usr/local/cargo/bin/graph-node /usr/local/cargo/bin/graphman /usr/local/bin/ COPY --from=graph-node-build /etc/image-info /etc/image-info +COPY --from=envsubst /go/bin/envsubst /usr/local/bin/ COPY docker/Dockerfile /Dockerfile CMD start From bba2f17d17392773fde9e5e7692c1883d4fe123c Mon Sep 17 00:00:00 2001 From: Filippo Costa Date: Wed, 21 Sep 2022 16:27:34 +0200 Subject: [PATCH 2/2] docs: variable expansion in config.md --- docs/config.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/config.md b/docs/config.md index 8b65e2511a3..8020334918c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -11,6 +11,11 @@ The TOML file consists of four sections: * `[ingestor]` sets the name of the node responsible for block ingestion. * `[deployment]` describes how to place newly deployed subgraphs. +Some of these sections support environment variable expansion out of the box, +most notably Postgres connection strings. The official `graph-node` Docker image +includes [`envsubst`](https://github.com/a8m/envsubst) for more complex use +cases. + ## Configuring Multiple Databases For most use cases, a single Postgres database is sufficient to support a