Dockerfile that works with postgrest 0.4 (#810)

Also an example docker-compose
This commit is contained in:
Joe Nelson
2017-02-17 23:43:35 -08:00
committed by GitHub
parent 728e40c96c
commit 2aabbbae58
3 changed files with 21 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
FROM debian:jessie
ENV POSTGREST_VERSION 0.4.0.0
RUN apt-get update && \
apt-get install -y tar xz-utils wget libpq-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN wget http://github.com/begriffs/postgrest/releases/download/v${POSTGREST_VERSION}/postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz && \
tar --xz -xvf postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz && \
mv postgrest /usr/local/bin/postgrest && \
rm postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz
# PostgREST reads /etc/postgrest.conf so map the configuration
# file in when you run this container
CMD exec postgrest /etc/postgrest.conf
EXPOSE 3000
+3
View File
@@ -0,0 +1,3 @@
db-uri = "postgres://app_user:password@postgres:5432/app_db"
db-schema = "public"
db-anon-role = "app_user"
+17
View File
@@ -0,0 +1,17 @@
stgrest:
image: begriffs/postgrest:latest
ports:
- "3000:3000"
volumes:
- ./config.conf:/etc/postgrest.conf
links:
- postgres:postgres
postgres:
image: postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: app_db
POSTGRES_USER: app_user
POSTGRES_PASSWORD: password