-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.aws.yml
More file actions
110 lines (99 loc) · 3.03 KB
/
docker-compose.aws.yml
File metadata and controls
110 lines (99 loc) · 3.03 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
# docker-compose.aws.yml
#
# Use this instead of docker-compose.yml when running on AWS.
# Vault is removed. KMS is handled by AWS KMS.
#
# Required env vars (set in .env or your CI/CD secret manager):
#
# AWS_KMS_KEY_ID=arn:aws:kms:us-east-1:123456789012:key/... (or alias/vaultkey-master)
# AWS_REGION=us-east-1
#
# Authentication options (pick one):
# 1. IAM role on EC2/ECS/EKS — recommended, no credentials needed in env
# 2. Explicit credentials — set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
# (shown as optional below, leave unset when using instance roles)
#
# Usage:
# docker compose -f docker-compose.aws.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: aws
AWS_KMS_KEY_ID: ${AWS_KMS_KEY_ID}
AWS_REGION: ${AWS_REGION:-us-east-1}
# Leave these unset when running on EC2/ECS/EKS with an IAM role attached.
# Set them only for local development or environments without instance roles.
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-}
# 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: