-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (73 loc) · 1.67 KB
/
docker-compose.yml
File metadata and controls
77 lines (73 loc) · 1.67 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
version: '3.8'
services:
webshelf:
build:
context: .
dockerfile: Dockerfile
pull_policy: build
container_name: webshelf
ports:
- "3000:3000"
environment:
- RUST_LOG=info
- WEBSHELF_DATABASE_URL=postgres://postgres:password@postgres:5432/webshelf
- WEBSHELF_REDIS_URL=redis://redis:6379
- WEBSHELF_JWT_SECRET=your-super-secret-key-change-in-production
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- webshelf-net
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
postgres:
image: postgres:16
pull_policy: missing
container_name: webshelf-postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=webshelf
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- webshelf-net
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
pull_policy: missing
container_name: webshelf-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- webshelf-net
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres-data:
driver: local
redis-data:
driver: local
networks:
webshelf-net:
driver: bridge