-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.prod.yml
76 lines (69 loc) · 2.72 KB
/
docker-compose.prod.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
volumes:
node-data: {}
postgres_db: {}
services:
# Hasura GraphQL Engine
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: ${DATABASE_URL}
HASURA_GRAPHQL_DATABASE_URL: ${DATABASE_URL}
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: "false" # 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
backend:
build:
context: ./backend
dockerfile: Dockerfile
working_dir: /usr/src/app
volumes:
- ./backend:/usr/src/app
ports:
- "3000:3000"
restart: unless-stopped
environment:
DATABASE_URL: ${DATABASE_URL}
RPC_ENDPOINT: ${RPC_ENDPOINT}
PRIVATE_KEYS_PATH: ${PRIVATE_KEYS_PATH}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS}
OBJECT_MAPPING_ARCHIVER_URL: ${OBJECT_MAPPING_ARCHIVER_URL}
MAX_CACHE_SIZE: ${MAX_CACHE_SIZE}
JWT_SECRET: ${JWT_SECRET}
FILES_GATEWAY_URL: ${FILES_GATEWAY_URL}
FILES_GATEWAY_TOKEN: ${FILES_GATEWAY_TOKEN}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 5