-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
85 lines (80 loc) · 1.8 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
version: "3"
services:
api:
build:
context: ./
dockerfile: docker/api/Dockerfile
image: talkcorner/api
restart: always
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
env_file:
- .env
environment:
- IS_PRODUCTION=yes
depends_on:
migrations:
condition: service_completed_successfully
nats:
condition: service_started
healthcheck:
test: [ "CMD", "curl", "-f", "http://server:${SERVER_PORT}/api/v1/healthcheck/" ]
interval: 10s
timeout: 5s
retries: 5
broadcaster:
build:
context: ./
dockerfile: docker/broadcaster/Dockerfile
image: talkcorner/broadcaster
restart: always
env_file:
- .env
environment:
- IS_PRODUCTION=yes
depends_on:
nats:
condition: service_started
migrations:
build:
context: ./
dockerfile: docker/migrations/Dockerfile
image: talkcorner/migrations
env_file:
- .env
environment:
- IS_PRODUCTION=yes
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:latest
volumes:
- ./postgres/data:/var/lib/postgresql/data/:z
restart: always
env_file:
- .env
expose:
- "${PG_PORT}"
environment:
- POSTGRES_HOST=${PG_HOST}
- POSTGRES_USER=${PG_USER}
- POSTGRES_PASSWORD=${PG_PASSWORD}
- POSTGRES_DB=${PG_DB}
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
nats:
image: nats
volumes:
- ./nats/data:/etc/nats
restart: always
env_file:
- .env
expose:
- "${NATS_CLIENT_PORT}"
- "${NATS_HTTP_PORT}"
- "${NATS_ROUTING_PORT}"
command: ["-js", "--user", "${NATS_USER}", "--pass", "${NATS_PASSWORD}"]