-
Notifications
You must be signed in to change notification settings - Fork 15
/
infra.docker-compose.yml
108 lines (104 loc) · 3.91 KB
/
infra.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
version: "3.8"
services:
db:
container_name: db
image: postgres:14.3-alpine
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: marketplace_db
ports:
- 5432:5432
volumes:
- db:/var/lib/postgresql/data
- ./scripts/initdb.d:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD", "pg_isready", "-d", "marketplace_db", "-U", "postgres"]
interval: 2s
timeout: 1s
retries: 20
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3.11-management
restart: unless-stopped
volumes:
- rabbitmq:/var/lib/rabbitmq
ports:
- 5672:5672
- 15672:15672
healthcheck:
test: bash -c ':> /dev/tcp/127.0.0.1/5672' || exit 1
interval: 2s
timeout: 1s
retries: 10
start_period: 5s
hasura:
container_name: hasura
image: hasura/graphql-engine:v2.15.2
depends_on:
db:
condition: service_healthy
ports:
- "8080:8080"
restart: unless-stopped
environment:
DATABASE_URL: postgres://postgres:postgres@db/marketplace_db
BACKEND_GRAPHQL_URL: ${BACKEND_GRAPHQL_URL:-http://host.docker.internal:8000/graphql}
BACKEND_REST_API_URL: ${BACKEND_REST_API_URL:-http://host.docker.internal:8000/api}
BACKEND_GRAPHQL_API_KEY: ${BACKEND_GRAPHQL_API_KEY:-myapikey}
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgres@db/marketplace_db
HASURA_GRAPHQL_ENABLE_CONSOLE: "false" # use Hasura CLI to access the console, see projet README
HASURA_GRAPHQL_DEV_MODE: "true"
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET:-myadminsecretkey}
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: public
HASURA_GRAPHQL_ENABLE_REMOTE_SCHEMA_PERMISSIONS: "true"
HASURA_GRAPHQL_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET}
HASURA_GRAPHQL_EXPERIMENTAL_FEATURES: naming_convention
HASURA_GRAPHQL_DEFAULT_NAMING_CONVENTION: graphql-default
HASURA_EVENT_WEBHOOK: https://enqxb9z71g92.x.pipedream.net/
HASURA_SUGGESTION_WEBHOOK: ${HASURA_SUGGESTION_WEBHOOK:-https://en2avf74ldu54.x.pipedream.net}
ENV: local
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: bash -c ':> /dev/tcp/127.0.0.1/8080' || exit 1
interval: 2s
timeout: 1s
retries: 10
start_period: 5s
hasura-auth:
container_name: hasura-auth
image: onlydustxyz/hasura-auth:latest
depends_on:
db:
condition: service_healthy
hasura:
condition: service_healthy
environment:
HASURA_GRAPHQL_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET}
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgres@db/marketplace_db
HASURA_GRAPHQL_GRAPHQL_URL: http://hasura:8080/v1/graphql
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET:-myadminsecretkey}
AUTH_ACCESS_TOKEN_EXPIRES_IN: 604800 # 1 week
AUTH_JWT_CUSTOM_CLAIMS: '{"projectsLeaded":"registeredUser.projectsLeaded[].projectId","githubUserId":"registeredUser.githubUserId","odAdmin":"registeredUser.admin","githubAccessToken":"userGithubProvider.accessToken"}'
AUTH_USER_DEFAULT_ALLOWED_ROLES: public,me,registered_user
AUTH_USER_DEFAULT_ROLE: registered_user
AUTH_LOG_LEVEL: info
AUTH_CLIENT_URL: http://localhost:5173/login
AUTH_PROVIDER_GITHUB_ENABLED: "true"
AUTH_SERVER_URL: http://localhost:4000
AUTH_PROVIDER_GITHUB_CLIENT_ID: ${AUTH_PROVIDER_GITHUB_CLIENT_ID:-my_github_client_id}
AUTH_PROVIDER_GITHUB_CLIENT_SECRET: ${AUTH_PROVIDER_GITHUB_CLIENT_SECRET:-my_github_client_secret}
ports:
- "4000:4000"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:4000/healthz || exit 1
interval: 2s
timeout: 1s
retries: 30
volumes:
rabbitmq:
db:
driver: local