-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
161 lines (152 loc) · 4.31 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
161 lines (152 loc) · 4.31 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
services:
controller:
image: localhost/netpulse-controller:latest
build:
context: .
dockerfile: ./docker/controller.dockerfile
env_file:
- .env
environment:
- NETPULSE_STORAGE__STAGING=/app/storage/staging
volumes:
- ./config:/app/config:z
- ./redis/tls:/app/redis/tls:ro,z
- netpulse_staging:/app/storage/staging
ports:
- "9000:9000"
networks:
- "netpulse-network"
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
node-worker:
image: localhost/netpulse-node-worker:latest
build:
context: .
dockerfile: ./docker/node_worker.dockerfile
env_file:
- .env
environment:
- NETPULSE_STORAGE__STAGING=/app/storage/staging
volumes:
- ./config:/app/config:z
- ./redis/tls:/app/redis/tls:ro,z
- netpulse_staging:/app/storage/staging
depends_on:
redis:
condition: service_healthy
networks:
- "netpulse-network"
restart: unless-stopped
deploy:
replicas: 2
fifo-worker:
image: localhost/netpulse-fifo-worker:latest
build:
context: .
dockerfile: docker/fifo_worker.dockerfile
env_file:
- .env
environment:
- NETPULSE_STORAGE__STAGING=/app/storage/staging
volumes:
- ./config:/app/config:z
- ./redis/tls:/app/redis/tls:ro,z
- netpulse_staging:/app/storage/staging
depends_on:
redis:
condition: service_healthy
networks:
- "netpulse-network"
restart: unless-stopped
archiver-worker:
image: localhost/netpulse-archiver-worker:latest
build:
context: .
dockerfile: docker/archiver_worker.dockerfile
env_file:
- .env
volumes:
- ./config:/app/config:z
- ./redis/tls:/app/redis/tls:ro,z
depends_on:
redis:
condition: service_healthy
networks:
- "netpulse-network"
restart: on-failure # exits 0 when MongoDB disabled (no restart); restarts on connection errors
vault:
image: hashicorp/vault:1.21
container_name: netpulse-vault
env_file:
- .env
environment:
- VAULT_ADDR=http://127.0.0.1:8200
cap_add:
- IPC_LOCK
ports:
- "8200:8200"
volumes:
- ./vault/config:/vault/config:ro,z
- ./vault/data:/vault/data:z
- vault_logs:/vault/logs
command: vault server -config=/vault/config/vault.hcl
networks:
- "netpulse-network"
restart: unless-stopped
healthcheck:
# `vault status` exits 2 when sealed (not an error for us), 0 when unsealed.
# Exit codes 1+ are errors; exit 2 means "sealed but reachable" which is healthy enough
# for vault-init to proceed. Without this, Docker marks the container unhealthy
# while sealed, and vault-init (which depends on service_healthy) never starts.
test: ["CMD-SHELL", "vault status -address=http://127.0.0.1:8200 || [ $? -eq 2 ]"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
vault-init:
image: hashicorp/vault:1.21
container_name: netpulse-vault-init
depends_on:
vault:
condition: service_healthy
volumes:
- ./scripts/vault_auto_init.sh:/usr/local/bin/vault_auto_init.sh:ro
- ./vault/data:/vault/data:z
entrypoint: ["/bin/sh", "/usr/local/bin/vault_auto_init.sh"]
restart: on-failure
env_file:
- .env
environment:
- VAULT_ADDR=http://vault:8200
networks:
- "netpulse-network"
redis:
image: redis:7-bookworm
env_file:
- .env
volumes:
- ./redis/redis.conf:/etc/redis/redis.conf:ro,z
- ./redis/tls:/etc/redis/tls:ro,z
- redis_data:/data
command: redis-server /etc/redis/redis.conf --requirepass "${NETPULSE_REDIS__PASSWORD}"
networks:
- "netpulse-network"
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "--tls", "--cert", "/etc/redis/tls/redis.crt", "--key", "/etc/redis/tls/redis.key", "--cacert", "/etc/redis/tls/ca.crt", "-p", "6379", "-a", "${NETPULSE_REDIS__PASSWORD}", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
netpulse-network:
name: "netpulse-network"
volumes:
redis_data:
name: "netpulse-redis-data"
vault_logs:
name: "netpulse-vault-logs"
netpulse_staging:
name: "netpulse-staging"