-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
148 lines (138 loc) · 3.22 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
version: "3.8"
networks:
stori-network:
driver: bridge
services:
nats:
image: nats:latest
ports:
- "4222:4222"
- "8222:8222"
command: "--jetstream"
healthcheck:
test: ["CMD", "/nats-server", "--version"]
interval: 10s
timeout: 5s
retries: 5
networks:
- stori-network
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.14.0
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ports:
- "9200:9200"
volumes:
- esdata:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200 >/dev/null || exit 1"]
interval: 30s
timeout: 10s
retries: 5
networks:
- stori-network
kibana:
image: docker.elastic.co/kibana/kibana:7.14.0
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
- elasticsearch
networks:
- stori-network
postgres:
image: postgres:13
environment:
POSTGRES_DB: stori
POSTGRES_USER: storiuser
POSTGRES_PASSWORD: storipass
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U storiuser -d stori"]
interval: 10s
timeout: 5s
retries: 5
networks:
- stori-network
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin_password
ports:
- "5050:80"
depends_on:
- postgres
networks:
- stori-network
mailhog:
image: mailhog/mailhog
ports:
- "1025:1025"
- "8025:8025"
networks:
- stori-network
worker:
build:
context: .
dockerfile: Dockerfile.worker
depends_on:
nats:
condition: service_healthy
elasticsearch:
condition: service_healthy
postgres:
condition: service_healthy
mailhog:
condition: service_started
environment:
- DATABASE_URL=postgres://storiuser:storipass@postgres:5432/stori?sslmode=disable
- ELASTICSEARCH_URL=http://elasticsearch:9200
- NATS_URL=nats://nats:4222
- SMTP_HOST=mailhog
- SMTP_PORT=1025
networks:
- stori-network
restart: on-failure
api:
build:
context: .
dockerfile: Dockerfile.api
ports:
- "8080:8080"
- "50051:50051"
depends_on:
nats:
condition: service_healthy
elasticsearch:
condition: service_healthy
postgres:
condition: service_healthy
mailhog:
condition: service_started
worker:
condition: service_started
environment:
- DATABASE_URL=postgres://storiuser:storipass@postgres:5432/stori?sslmode=disable
- ELASTICSEARCH_URL=http://elasticsearch:9200
- NATS_URL=nats://nats:4222
- SMTP_HOST=mailhog
- SMTP_PORT=1025
- API_PORT=8080
- GRPC_PORT=50051
networks:
- stori-network
restart: on-failure
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 5
volumes:
esdata:
pgdata: