-
Notifications
You must be signed in to change notification settings - Fork 488
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
55 lines (52 loc) · 1.33 KB
/
docker-compose.yml
File metadata and controls
55 lines (52 loc) · 1.33 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
services:
api:
build:
context: ./server
container_name: kvault-api
env_file:
- .env
volumes:
- kvault_data:/app/data
# expose is internal-only (other services in the same compose network can reach it).
expose:
- "8787"
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:8787/api/health').then((r)=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"]
interval: 10s
timeout: 3s
retries: 5
start_period: 10s
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: kvault-redis
command: ["redis-server", "--appendonly", "yes"]
volumes:
- kvault_redis:/data
# expose is internal-only (other services in the same compose network can reach it).
expose:
- "6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
start_period: 5s
restart: unless-stopped
profiles:
- redis
web:
build:
context: .
dockerfile: frontend/Dockerfile
container_name: kvault-web
depends_on:
api:
condition: service_healthy
# ports publishes container port to host, so browser/users can access web UI.
ports:
- "${WEB_PORT:-8080}:80"
restart: unless-stopped
volumes:
kvault_data:
kvault_redis: