inthf commited on
Commit
a60848c
·
verified ·
1 Parent(s): ea57d8d

postgrest download

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -39
Dockerfile CHANGED
@@ -1,43 +1,22 @@
1
- version: "3.8"
 
2
 
3
- services:
4
- cloudflared:
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
- postgrest:
17
- image: postgrest/postgrest
18
- # Expose post 3000 and access postgrest locally by uncommenting
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
- postgres:
32
- image: postgres
33
- restart: always
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
- volumes:
43
- postgres-data: {}
 
 
 
 
 
 
 
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"]