-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (56 loc) · 2.11 KB
/
docker-compose.yml
File metadata and controls
60 lines (56 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: '2'
services:
### DB START
# This is the database to which the all the other components in the stack will connect and interact with
# (but mostly it's PostgREST that is going to be responsible for the bulk of the db traffic)
# Having the database in a container is very convenient in development but in production you will
# use a separate database instance, like Amazon RDS, i.e. in production this section will be
# commented and in the .env file you will specify the ip of your separate database instance
db:
image: delibrium/postgres
ports:
- "5434:5432"
environment:
# env vars specific to postgres image used on first boot
- POSTGRES_USER=${SUPER_USER}
- POSTGRES_PASSWORD=${SUPER_USER_PASSWORD}
- POSTGRES_DB=${DB_NAME}
# env vars useful for our sql scripts
- SUPER_USER=${SUPER_USER}
- SUPER_USER_PASSWORD=${SUPER_USER_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- DB_ANON_ROLE=${DB_ANON_ROLE}
- DEVELOPMENT=${DEVELOPMENT}
- JWT_SECRET=${JWT_SECRET}
volumes:
- "./database:/docker-entrypoint-initdb.d"
### DB END
# PostgREST instance, is responsible for communicating with the database
# and providing a REST api, (almost) every request that is sent to the database goes through it
postgrest:
image: subzerocloud/postgrest
ports:
- "3001:3000"
links:
- db:db
environment:
- PGRST_DB_URI=postgres://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}
- PGRST_DB_SCHEMA=${DB_SCHEMA}
- PGRST_DB_ANON_ROLE=${DB_ANON_ROLE}
- PGRST_DB_POOL=${DB_POOL}
- PGRST_JWT_SECRET=${JWT_SECRET}
- PGRST_MAX_ROWS=${MAX_ROWS}
- PGRST_PRE_REQUEST=${PRE_REQUEST}
- PGRST_SERVER_PROXY_URI=${SERVER_PROXY_URI}
nginx:
image: nginx
links:
- postgrest:postgrest
ports:
- "8082:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/aula.conf
- ./www:/usr/share/nginx/html
command: /bin/bash -c "cat /etc/nginx/conf.d/aula.conf > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"