-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
87 lines (84 loc) · 1.77 KB
/
docker-compose.yaml
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
services:
dev_api:
build:
context: .
dockerfile: Dockerfile
environment:
- NODE_ENV=development
- MONGO_URI=$MONGO_URI
ports:
- 8080:8080
volumes:
- ./src:/app/src
depends_on:
postgres_db:
condition: service_healthy
# mongodb:
# condition: service_healthy
env_file:
- .env
# Postgress
postgres_db:
image: postgres
ports:
- "5432:5432"
restart: always
user: $DB_USERNAME
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=$POSTGRES_DB
- POSTGRES_USER=$DB_USERNAME
- POSTGRES_PORT=$DB_PORT
- POSTGRES_PASSWORD=$DB_PASSWORD
expose:
- 5432
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
env_file:
- .env
# Mongodb
mongodb:
restart: always
image: mongodb/mongodb-community-server:6.0-ubi8
volumes:
- mongo_data:/data/db
environment:
- MONGO_URI=$MONGO_URI
- MONGO_INITDB_ROOT_USERNAME=$MONGO_USERNAME
- MONGO_INITDB_ROOT_PASSWORD=$MONGO_PASSWORD
ports:
- 27017:27017
expose:
- 27017
healthcheck:
test: ["CMD", "mongo_isready"]
interval: 10s
timeout: 5s
retries: 1
env_file:
- .env
# Redis cache and redis insight on port 8001
redis-cache:
image: redis/redis-stack:latest
ports:
- "6379:6379"
- '8001:8001'
volumes:
- redis-data:/data/db
healthcheck:
test: redis-cli ping
interval: 3s
timeout: 5s
retries: 5
environment:
- REDIS_ARGS=--requirepass mystrongpassword
- REDISTIMESERIES_ARGS=RETENTION_POLICY=20
volumes:
db-data:
mongo_data:
redis-data:
# redisinsight: