Skip to content

Commit

Permalink
docker: ship envsubst with the image (#3974)
Browse files Browse the repository at this point in the history
* docker: ship envsubst with the image

* docs: variable expansion in config.md
  • Loading branch information
neysofu authored Sep 22, 2022
1 parent fb8a94b commit 8ce2d61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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

0 comments on commit 8ce2d61

Please sign in to comment.