-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.gcp.yml
More file actions
114 lines (103 loc) · 3.2 KB
/
docker-compose.gcp.yml
File metadata and controls
114 lines (103 loc) · 3.2 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
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
113
114
# docker-compose.gcp.yml
#
# Use this instead of docker-compose.yml when running on Google Cloud.
# Vault is removed. KMS is handled by GCP Cloud KMS.
#
# Required env vars (set in .env or your CI/CD secret manager):
#
# GCP_KMS_KEY_NAME — full resource name of the key version
#
# Authentication — pick one, no file mounts required:
#
# Option A: Inline credentials (running outside GCP)
# Set GOOGLE_APPLICATION_CREDENTIALS_JSON to the full contents of your
# service account key JSON. Paste the JSON as a single-line string or
# use your secret manager to inject it.
#
# Option B: Workload Identity (GKE, Cloud Run, GCE)
# Attach a service account to your compute resource.
# Leave both credential env vars unset — the SDK finds them automatically.
#
# Usage:
# docker compose -f docker-compose.gcp.yml up
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: vaultkey
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: vaultkey
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/migrations:/docker-entrypoint-initdb.d:ro
networks:
- internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U vaultkey"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
restart: unless-stopped
command: >
redis-server
--requirepass ${REDIS_PASSWORD:-redischangeme}
--appendonly yes
--appendfsync everysec
volumes:
- redis_data:/data
networks:
- internal
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-redischangeme}", "ping"]
interval: 5s
timeout: 3s
retries: 10
api:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
PORT: 8080
DATABASE_URL: postgres://vaultkey:${POSTGRES_PASSWORD:-changeme}@postgres:5432/vaultkey?sslmode=disable
# KMS
KMS_PROVIDER: gcp
GCP_KMS_KEY_NAME: ${GCP_KMS_KEY_NAME}
# Option A: inline JSON credentials (no file mount needed)
# Paste the service account key JSON as a single env var.
# Leave unset when using Workload Identity on GKE/Cloud Run.
GOOGLE_APPLICATION_CREDENTIALS_JSON: ${GOOGLE_APPLICATION_CREDENTIALS_JSON:-}
# Redis
REDIS_ADDR: redis:6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-redischangeme}
# Worker
WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-10}
WORKER_POLL_TIMEOUT_SEC: 5
# EVM RPC endpoints
EVM_RPC_1: ${EVM_RPC_1:-https://cloudflare-eth.com}
EVM_RPC_137: ${EVM_RPC_137:-https://polygon-rpc.com}
EVM_RPC_42161: ${EVM_RPC_42161:-https://arb1.arbitrum.io/rpc}
EVM_RPC_8453: ${EVM_RPC_8453:-https://mainnet.base.org}
EVM_RPC_10: ${EVM_RPC_10:-https://mainnet.optimism.io}
SOLANA_RPC_URL: ${SOLANA_RPC_URL:-https://api.mainnet-beta.solana.com}
ports:
- "8080:8080"
networks:
- internal
- external
networks:
internal:
internal: true
external:
internal: false
volumes:
postgres_data:
redis_data: