-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.base.yml
81 lines (73 loc) · 2.78 KB
/
docker-compose.base.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
volumes:
node-data: {}
postgres_data: {}
networks:
auto-drive-network:
driver: bridge
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
working_dir: /usr/src/app
volumes:
- ./backend:/usr/src/app
restart: unless-stopped
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 60s
timeout: 10s
retries: 5
hasura:
image: hasura/graphql-engine:v2.40.0
depends_on:
backend:
condition: service_healthy
volumes:
- ./hasura/metadata:/hasura-metadata
restart: unless-stopped
environment:
# Essential Environment Variables
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET} # Admin access secret
HASURA_GRAPHQL_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET} # JWT authentication secret
# Console and Development Mode
HASURA_GRAPHQL_ENABLE_CONSOLE: ${HASURA_GRAPHQL_ENABLE_CONSOLE} # Disable console in production
HASURA_GRAPHQL_DEV_MODE: "true" # Disable development mode features
# Role and CORS Settings
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: user # Default role for unauthenticated users
HASURA_GRAPHQL_CORS_DOMAIN: ${HASURA_GRAPHQL_CORS_DOMAIN} # Allowed domains for CORS
HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES: "true"
# Performance and Connection Settings
HASURA_GRAPHQL_MAX_CONNECTIONS: 100 # Maximum number of database connections
HASURA_GRAPHQL_STRIPES: 2 # Number of connection pool stripes
HASURA_GRAPHQL_CONNECTIONS_PER_STRIPE: 50 # Connections per stripe
HASURA_GRAPHQL_IDLE_TIMEOUT: 180 # Idle connection timeout in seconds
HASURA_GRAPHQL_TIMEOUT: 60 # Request timeout in seconds
# Logging Settings
HASURA_GRAPHQL_LOG_LEVEL: "warn" # Log verbosity level
HASURA_GRAPHQL_ENABLED_LOG_TYPES: "startup,http-log,webhook-log,websocket-log,query-log" # Enabled log types
# Security and Authorization
HASURA_GRAPHQL_ENABLE_ALLOWLIST: "false" # Disable query allowlisting
# Hasura Migrations and Metadata
HASURA_GRAPHQL_METADATA_DIR: /hasura-metadata
ports:
- "${HASURA_GRAPHQL_PORT}:8080"
command:
- graphql-engine
- serve
auth:
build:
context: ./auth
dockerfile: Dockerfile
ports:
- "${AUTH_PORT}:${AUTH_PORT}"
environment:
- DATABASE_URL=${DATABASE_URL}
- AUTH_PORT=${AUTH_PORT}
- JWT_SECRET=${JWT_SECRET}
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS}
- API_SECRET=${API_SECRET}