Running postgrest requires the libpq library runtime, not the -dev package. Make sure that tools that are used to download and extract the postgrest package do not remain installed in the image.
43 lines
1.3 KiB
Docker
43 lines
1.3 KiB
Docker
FROM debian:jessie
|
|
|
|
# Install libpq5
|
|
RUN apt-get -qq update && \
|
|
apt-get -qq install -y --no-install-recommends libpq5 && \
|
|
apt-get -qq clean && \
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
# Install postgrest
|
|
RUN POSTGREST_VERSION="0.4.1.0" \
|
|
BUILD_DEPS="curl ca-certificates xz-utils" && \
|
|
apt-get -qq update && \
|
|
apt-get -qq install -y --no-install-recommends $BUILD_DEPS && \
|
|
cd /tmp && \
|
|
curl -SLO https://github.com/begriffs/postgrest/releases/download/v${POSTGREST_VERSION}/postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz && \
|
|
tar -xJvf postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz && \
|
|
mv postgrest /usr/local/bin/postgrest && \
|
|
cd / && \
|
|
apt-get -qq purge --auto-remove -y $BUILD_DEPS && \
|
|
apt-get -qq clean && \
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
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
|
|
|
|
EXPOSE 3000
|