-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
89 lines (83 loc) · 1.79 KB
/
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
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
version: '3.9'
networks:
backend_network:
driver: bridge
frontend_network:
driver: bridge
volumes:
redis_data: null
pg_data: null
services:
client:
image: app_client
build:
context: ./client
target: development
container_name: app_client
restart: unless-stopped
env_file: .env
environment:
- PORT=${CLIENT_PORT}
- API_HOST=api
ports:
- ${CLIENT_PORT}:${CLIENT_PORT}
networks:
- frontend_network
volumes:
- './client:/home/node/app'
depends_on:
- api
command: npm run start
api:
image: app_api
build:
context: ./api
target: development
container_name: app_api
restart: unless-stopped
env_file: .env
environment:
- PORT=${API_PORT}
- POSTGRES_HOST=postgres
- REDIS_HOST=redis
- CLIENT_HOST=client
ports:
- ${API_PORT}:${API_PORT}
- 9222:9222
networks:
- frontend_network
- backend_network
volumes:
- './api:/home/node/app'
depends_on:
- postgres
- redis
command: ./wait-for.sh postgres:${POSTGRES_PORT} -- npm run dev
postgres:
image: 'postgres:13.1-alpine'
container_name: 'postgres'
restart: unless-stopped
env_file: .env
volumes:
- 'pg_data:/var/lib/postgresql/data:rw'
expose:
- '${POSTGRES_PORT}'
ports:
- '15432:${POSTGRES_PORT}'
networks:
- 'backend_network'
command: -p ${POSTGRES_PORT}
redis:
image: 'redis:6.2.0-alpine'
container_name: 'redis'
restart: unless-stopped
env_file: .env
volumes:
- 'redis_data:/data'
expose:
- '${REDIS_PORT}'
ports:
- '16379:${REDIS_PORT}'
networks:
- 'backend_network'
command: --port ${REDIS_PORT} --requirepass ${REDIS_PASSWORD}