-
-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathdocker-compose-demo.yml
More file actions
51 lines (46 loc) · 982 Bytes
/
docker-compose-demo.yml
File metadata and controls
51 lines (46 loc) · 982 Bytes
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
version: "3.8"
services:
sb:
image: staticbackend:latest
container_name: demo_sb
ports:
- "8099:8099"
env_file:
- .env
depends_on:
- "db"
- "redis"
# For PostgreSQL
db:
image: postgres:15-alpine
container_name: demo_pg
restart: always
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- postgres_data:/var/lib/postgresql/data
- ./sql/0001_bootstrap_db.sql:/docker-entrypoint-initdb.d/create_tables.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# For MongoDB
#mongo:
# image: mongo:4.4
# container_name: demo_mongo
# volumes:
# - mongo_data:/data/db/mongo
# ports:
# - "27017:27017"
redis:
image: "redis:alpine"
container_name: demo_redis
ports:
- "6379:6379"
volumes:
postgres_data:
#mongo_data: