-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (118 loc) · 2.73 KB
/
docker-compose.yml
File metadata and controls
126 lines (118 loc) · 2.73 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: '3.7'
services:
postgres:
container_name: 'postgres'
image: postgres
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER:-root}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-root}
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
networks:
- postgres
restart: unless-stopped
healthcheck:
test: pg_isready -U root
interval: 10s
timeout: 5s
retries: 5
db-migrations:
container_name: db-migrations
build:
context: backend
dockerfile: Dockerfile
networks:
- postgres
environment:
DATABASE_URL: postgresql://root:root@postgres:5432/nest
command: npx prisma migrate dev
volumes:
- ./backend:/home/node/app
- backend-node_modules:/home/node/app/node_modules
depends_on:
- postgres
rabbitmq:
container_name: rabbitmq
image: rabbitmq
ports:
- 5672:5672
networks:
- rabbitmq
restart: unless-stopped
depends_on:
- postgres
- db-migrations
backend:
container_name: backend
build:
context: backend
dockerfile: Dockerfile
environment:
DATABASE_URL: postgresql://root:root@postgres:5432/nest
PORT: 4000
ALLOWED_ORIGIN: http://localhost:3000
SESSION_SECRET: secret
FRONTEND_URL: http://localhost:3000
RABBITMQ_URL: amqp://rabbitmq:5672
volumes:
- ./backend:/home/node/app
- backend-node_modules:/home/node/app/node_modules
ports:
- "4000:4000"
networks:
- postgres
- rabbitmq
restart: unless-stopped
depends_on:
- rabbitmq
- postgres
- db-migrations
messages:
container_name: messages
build:
context: messages
dockerfile: Dockerfile
environment:
DATABASE_URL: postgresql://root:root@postgres:5432/nest
PORT: 4000
ALLOWED_ORIGIN: http://localhost:3000
SESSION_SECRET: secret
FRONTEND_URL: http://localhost:3000
RABBITMQ_URL: amqp://rabbitmq:5672
volumes:
- ./messages:/home/node/app
- backend-node_modules:/home/node/app/node_modules
ports:
- "4001:4001"
networks:
- postgres
- rabbitmq
restart: unless-stopped
depends_on:
- rabbitmq
- postgres
- db-migrations
frontend:
container_name: frontend
build:
context: frontend
dockerfile: dev.Dockerfile
ports:
- 3000:3000
environment:
BACKEND_URL: http://localhost:4000
volumes:
- ./frontend:/home/node/app
- frontend-node_modules:/home/node/app/node_modules
networks:
postgres:
driver: bridge
rabbitmq:
driver: bridge
volumes:
postgres:
backend-node_modules:
frontend-node_modules: