Skip to content

Commit

Permalink
WIP: use env interpolation in config
Browse files Browse the repository at this point in the history
  • Loading branch information
begriffs committed Mar 13, 2017
1 parent 206ab16 commit 5c7feec
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
15 changes: 15 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ RUN wget http://github.com/begriffs/postgrest/releases/download/v${POSTGREST_VER
mv postgrest /usr/local/bin/postgrest && \
rm postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz

COPY postgrest.conf /etc/postgrest.conf


ENV PGRST_DB_URI= \
PGRST_DB_SCHEMA=public \
PGRST_DB_ANON_ROLE= \
PGRST_DB_POOL=100 \
PGRST_SERVER_HOST=*4 \
PGRST_SERVER_PORT=3000 \
PGRST_SERVER_PROXY_URL= \
PGRST_JWT_SECRET= \
PGRST_SECRET_IS_BASE64=false \
PGRST_MAX_ROWS= \
PGRST_PRE_REQUEST=

# PostgREST reads /etc/postgrest.conf so map the configuration
# file in when you run this container
CMD exec postgrest /etc/postgrest.conf
Expand Down
8 changes: 5 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
stgrest:
image: begriffs/postgrest:latest
image: pg_local
ports:
- "3000:3000"
volumes:
- ./config.conf:/etc/postgrest.conf
links:
- postgres:postgres
environment:
PGRST_DB_URI: postgres://app_user:password@postgres:5432/app_db
PGRST_DB_SCHEMA: public
PGRST_DB_ANON_ROLE: app_user

postgres:
image: postgres
Expand Down
14 changes: 14 additions & 0 deletions docker/postgrest.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
db-uri = "$(PGRST_DB_URI)"
db-schema = "$(PGRST_DB_SCHEMA)"
db-anon-role = "$(PGRST_DB_ANON_ROLE)"
db-pool = "$(PGRST_DB_POOL)"

server-host = "$(PGRST_SERVER_HOST)"
server-port = "$(PGRST_SERVER_PORT)"

server-proxy-url = "$(PGRST_SERVER_PROXY_URL)"
jwt-secret = "$(PGRST_JWT_SECRET)"
secret-is-base64 = "$(PGRST_SECRET_IS_BASE64)"

max-rows = "$(PGRST_MAX_ROWS)"
pre-request = "$(PGRST_PRE_REQUEST)"

0 comments on commit 5c7feec

Please sign in to comment.