-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
112 lines (104 loc) · 2.61 KB
/
docker-compose.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
version: "3.9"
services:
web:
build:
context: web
ports:
- 3000:3000
volumes:
- ./web:/usr/src/app
- /usr/src/app/node_modules
- /usr/src/app/.next
command: yarn dev
depends_on:
- graphql
- keycloak
environment:
NEXTAUTH_URL: http://localhost:3000
newsapi:
build:
context: newsapi
ports:
- 3001:3000
volumes:
- ./newsapi:/usr/src/app
- /usr/src/app/node_modules
command: yarn start:dev
environment:
- GUARDIAN_API_KEY=${GUARDIAN_API_KEY:-151b6ef6-267a-48e3-ac43-b7d9102f4706}
- NEWSAPI_API_KEY=${NEWSAPI_API_KEY:-cb7a160eba474d2387e86e06ddc36791}
db:
image: postgres:12
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgrespassword
graphql:
image: hasura/graphql-engine:v1.3.3.cli-migrations-v2
restart: always
ports:
- 8080:8080
depends_on:
- db
- keycloak
- newsapi
volumes:
- ./graphql/migrations:/hasura-migrations
- ./graphql/metadata:/hasura-metadata
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgrespassword@db:5432/postgres
HASURA_GRAPHQL_ENABLE_CONSOLE: "false"
HASURA_GRAPHQL_DEV_MODE: "true"
HASURA_GRAPHQL_ADMIN_SECRET: admin
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: public
HASURA_GRAPHQL_JWT_SECRET: |
{
"jwk_url": "http://keycloak:8080/auth/realms/news-app/protocol/openid-connect/certs",
"issuer": "http://localhost:8090/auth/realms/news-app",
"claims_map": {
"x-hasura-allowed-roles": ["user"],
"x-hasura-default-role": "user",
"x-hasura-user-id": { "path": "$$.user_id" }
}
}
keycloak_db:
image: postgres
restart: always
volumes:
- keycloak_db_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
keycloak:
build:
context: auth
restart: always
environment:
DB_VENDOR: POSTGRES
DB_ADDR: keycloak_db
DB_DATABASE: keycloak
DB_USER: keycloak
DB_SCHEMA: public
DB_PASSWORD: password
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
ports:
- 8090:8080
depends_on:
- keycloak_db
pgadmin:
image: dpage/pgadmin4
restart: always
depends_on:
- db
- keycloak_db
ports:
- 5050:80
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
db_data:
keycloak_db_data: