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

Ship envsubst with the Docker image to facilitate TOML templating #3974

Merged
merged 2 commits into from
Sep 22, 2022
Merged
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
9 changes: 9 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
5 changes: 5 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down