File size: 772 Bytes
a60848c ea57d8d a60848c ea57d8d a60848c ea57d8d a60848c ea57d8d a60848c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# Use a base image with Postgres installed
FROM postgres:15
# Install curl for downloading PostgREST
RUN apt-get update && apt-get install -y curl
# Define PostgREST version and download URL
ENV POSTGREST_VERSION=11.2.0
ENV POSTGREST_URL=https://github.com/PostgREST/postgrest/releases/download/v${POSTGREST_VERSION}/postgrest-linux-static
# Download and make PostgREST executable
RUN curl -L $POSTGREST_URL -o /usr/local/bin/postgrest \
&& chmod +x /usr/local/bin/postgrest
# Copy PostgREST config file into container
COPY postgrest.conf /etc/postgrest.conf
# Expose PostgreSQL default port and PostgREST port
EXPOSE 5432 3000
# Start PostgreSQL and then PostgREST
CMD ["bash", "-c", "docker-entrypoint.sh postgres & sleep 10 && postgrest /etc/postgrest.conf"]
|