postgrest download
Browse files- Dockerfile +18 -39
Dockerfile
CHANGED
|
@@ -1,43 +1,22 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
image: cloudflare/cloudflared:latest
|
| 6 |
-
environment:
|
| 7 |
-
TUNNEL_URL: http://postgrest:3000
|
| 8 |
-
command: "tunnel --no-autoupdate"
|
| 9 |
-
volumes:
|
| 10 |
-
- ./cloudflared:/etc/cloudflared
|
| 11 |
-
links:
|
| 12 |
-
- postgrest:postgrest
|
| 13 |
-
depends_on:
|
| 14 |
-
- postgrest
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
# the `ports` directive below
|
| 20 |
-
# ports:
|
| 21 |
-
# - "3000:3000"
|
| 22 |
-
environment:
|
| 23 |
-
PGRST_DB_URI: postgres://user:password@postgres:5432/db
|
| 24 |
-
PGRST_DB_SCHEMA: public
|
| 25 |
-
PGRST_DB_ANON_ROLE: user
|
| 26 |
-
links:
|
| 27 |
-
- postgres:postgres
|
| 28 |
-
depends_on:
|
| 29 |
-
- postgres
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
environment:
|
| 35 |
-
POSTGRES_DB: db
|
| 36 |
-
POSTGRES_USER: user
|
| 37 |
-
POSTGRES_PASSWORD: password
|
| 38 |
-
volumes:
|
| 39 |
-
- postgres-data:/var/lib/postgresql/data
|
| 40 |
-
- ./scripts:/scripts
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a base image with Postgres installed
|
| 2 |
+
FROM postgres:15
|
| 3 |
|
| 4 |
+
# Install curl for downloading PostgREST
|
| 5 |
+
RUN apt-get update && apt-get install -y curl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
# Define PostgREST version and download URL
|
| 8 |
+
ENV POSTGREST_VERSION=11.2.0
|
| 9 |
+
ENV POSTGREST_URL=https://github.com/PostgREST/postgrest/releases/download/v${POSTGREST_VERSION}/postgrest-linux-static
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
# Download and make PostgREST executable
|
| 12 |
+
RUN curl -L $POSTGREST_URL -o /usr/local/bin/postgrest \
|
| 13 |
+
&& chmod +x /usr/local/bin/postgrest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
# Copy PostgREST config file into container
|
| 16 |
+
COPY postgrest.conf /etc/postgrest.conf
|
| 17 |
+
|
| 18 |
+
# Expose PostgreSQL default port and PostgREST port
|
| 19 |
+
EXPOSE 5432 3000
|
| 20 |
+
|
| 21 |
+
# Start PostgreSQL and then PostgREST
|
| 22 |
+
CMD ["bash", "-c", "docker-entrypoint.sh postgres & sleep 10 && postgrest /etc/postgrest.conf"]
|