-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
50 lines (45 loc) · 983 Bytes
/
docker-compose.yml
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
version: "3.8"
services:
postgres:
image: postgres:latest
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: chat_db
ports:
- 5432:5432
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test"]
interval: 5s
retries: 5
start_period: 10s
redis:
image: redis:latest
restart: always
ports:
- 6379:6379
initialize:
image: node:20
build: ./backend
command: sh -c "cd /usr/src/app && npm install && npm run migrate"
env_file:
- ./backend/.env
depends_on:
postgres:
condition: service_healthy
backend:
image: node:20
build: ./backend
env_file:
- ./backend/.env
depends_on:
- initialize
- redis
ports:
- 3001:3001
command: sh -c "cd /usr/src/app && npm install && npm run start"
volumes:
postgres-data: