Repository navigation
Expand file tree
/
Copy pathdocker-compose.cloud.yml
More file actions
99 lines (89 loc) · 2.45 KB
/
Copy pathdocker-compose.cloud.yml
File metadata and controls
99 lines (89 loc) · 2.45 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
# Docker Compose configuration for cloud deployment
#
# This configuration shows how to deploy keyrot with persistent storage
# to cloud environments using managed volume solutions.
#
# Examples for different cloud providers are included below.
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
# For production, use secrets management (Docker Swarm, Kubernetes, Vault, etc.)
- KEYROT_ENCRYPTION_KEY=${KEYROT_ENCRYPTION_KEY}
- KEYROT_DATA_DIR=/data/keyrot
- NODE_ENV=production
volumes:
- keyrot-data:/data/keyrot
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 10s
order: start-first
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
resources:
limits:
cpus: '2'
memory: 1G
reservations:
cpus: '0.5'
memory: 256M
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
keyrot-data:
# Choose the appropriate driver for your cloud provider:
# AWS EFS (Elastic File System)
# driver: cloudstor:aws
# driver_opts:
# backing: efs
# perfmode: generalPurpose
# throughputmode: bursting
# Azure Files
# driver: azure_file
# driver_opts:
# share_name: keyrot-data
# storage_account_name: ${AZURE_STORAGE_ACCOUNT}
# Google Cloud Filestore
# driver: local
# driver_opts:
# type: nfs
# o: addr=${GCP_FILESTORE_IP},rw,nolock,hard,nointr,nfsvers=3
# device: ":/${GCP_FILESTORE_SHARE}"
# DigitalOcean Volumes (via CSI)
# driver: do-block-storage
# NFS (self-hosted or managed)
# driver: local
# driver_opts:
# type: nfs
# o: addr=${NFS_SERVER},rw,nolock
# device: ":${NFS_PATH}"
# Default: local storage (for testing only, not persistent in cloud)
driver: local
# Secrets example for Docker Swarm
# secrets:
# keyrot_encryption_key:
# external: true
#
# Then use in service:
# services:
# app:
# secrets:
# - keyrot_encryption_key
# environment:
# - KEYROT_ENCRYPTION_KEY_FILE=/run/secrets/keyrot_encryption_key