-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
64 lines (60 loc) · 1.21 KB
/
docker-compose.yaml
File metadata and controls
64 lines (60 loc) · 1.21 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
services:
server:
build:
context: .
dockerfile: Dockerfile.server
ports:
- "50051:50051"
networks:
- zenith-network
depends_on:
- db
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=${POSTGRES_USER}
- DB_PASSWORD=${POSTGRES_PASSWORD}
- DB_NAME=${POSTGRES_DB}
restart: on-failure
env_file:
- .env
command: >
sh -c "
until nc -z db 5432;
do
echo 'Waiting for database to be ready...';
sleep 2;
done;
echo 'Database is ready!';
./zenith-server"
client:
build:
context: .
dockerfile: Dockerfile.client
depends_on:
- server
networks:
- zenith-network
environment:
- SERVER_HOST=server
- SERVER_PORT=50051
stdin_open: true
tty: true
db:
image: postgres:latest
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "5433:5432"
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- zenith-network
volumes:
pgdata:
networks:
zenith-network:
driver: bridge