-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
71 lines (69 loc) · 2.37 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
services:
elasticsearch:
container_name: es_soc_movies
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.0
ports:
- 9200:9200
environment:
- discovery.type=single-node
- xpack.security.enabled=false
healthcheck:
test: curl -s http://localhost:9200 >/dev/null || exit 1
interval: 1s
timeout: 300s
retries: 100
postgres:
image: postgres:16.4
container_name: postgres_soc_movies
environment:
- ALLOW_EMPTY_PASSWORD=yes
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_DB=soc_movies_db
- POSTGRES_PASSWORD=soc_movies
- POSTGRES_USER=justin
ports:
- '5432:5432'
volumes:
- './tmp/volumes/postgres:/var/lib/postgresql/data'
- './src/test/resources/init.sql:/docker-entrypoint-initdb.d/init.sql'
index_creator:
container_name: es_index_creator
image: alpine/curl:8.2.1
depends_on:
elasticsearch:
condition: service_healthy
restart: no
command:
- /bin/sh
- -c
- |
curl -s -o /dev/null --fail-with-body -XGET elasticsearch:9200/_cat/indices/movies \
|| curl -s -X PUT "http://elasticsearch:9200/movies" -H "Content-Type: application/json" -d'
{
"settings": {"number_of_shards": 1, "number_of_replicas": 0},
"mappings": {
"properties": {
"id": {"type": "keyword"},
"name": { "type": "text" },
"description": { "type": "text" },
"tags" : { "type": "text" },
"avg_rating" : { "type": "double" },
"language" : { "type": "keyword" },
"released_year" : { "type": "date", "format": "yyyy" }
}
}
}' && curl -s -X PUT "http://elasticsearch:9200/movies_test" -H "Content-Type: application/json" -d'
{
"settings": {"number_of_shards": 1, "number_of_replicas": 0},
"mappings": {
"properties": {
"id": {"type": "keyword"},
"name": { "type": "text" },
"description": { "type": "text" },
"tags" : { "type": "text" },
"avg_rating" : { "type": "double" },
"language" : { "type": "keyword" },
"released_year" : { "type": "date", "format": "yyyy" }
}
}
}'