-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (49 loc) · 1.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
52 lines (49 loc) · 1.22 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
services:
api:
build: .
container_name: search_api
ports:
- "8000:8000"
env_file:
- .env
depends_on:
db:
condition: service_healthy
elasticsearch:
condition: service_healthy
db:
image: postgres:16
container_name: search_db
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "5433:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./tests/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_NAME}" ]
interval: 5s
timeout: 3s
retries: 5
elasticsearch:
image: elasticsearch:8.17.0
container_name: elastic_search
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ports:
- "9200:9200"
volumes:
- esdata:/var/lib/elasticsearch/data
healthcheck:
test: [ "CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\"\\|\"status\":\"yellow\"'" ]
interval: 10s
timeout: 5s
retries: 10
volumes:
pgdata:
esdata: