-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
168 lines (160 loc) · 4.27 KB
/
docker-compose.yml
File metadata and controls
168 lines (160 loc) · 4.27 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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
services:
db:
image: postgres:15-alpine
restart: always
env_file:
- ./.env # Load SQL environment variables
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- shared_network
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
sql-client:
image: python:3.9-slim
build:
context: .
dockerfile: sql/Dockerfile
container_name: sql-client
env_file:
- ./.env
networks:
- shared_network
depends_on:
db:
condition: service_healthy
volumes:
- ./sql:/app
- ./data:/app/data
- ~/.aws:/root/.aws:ro
working_dir: /app
entrypoint: ["tail", "-f", "/dev/null"]
opensearch-node1:
image: opensearchproject/opensearch:latest
container_name: opensearch-node1
env_file:
- opensearch/.env
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node1
- discovery.seed_hosts=opensearch-node1,opensearch-node2
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- "DISABLE_SECURITY_PLUGIN=true"
- plugins.security.ssl.http.enabled=false
- plugins.security.ssl.transport.enabled=false
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9200/_cluster/health"]
interval: 10s
timeout: 5s
retries: 5
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch-data1:/usr/share/opensearch/data
expose:
- "9200"
- "9600"
networks:
- shared_network
opensearch-node2:
image: opensearchproject/opensearch:latest
container_name: opensearch-node2
env_file:
- ./.env
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node2
- discovery.seed_hosts=opensearch-node1,opensearch-node2
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- "DISABLE_SECURITY_PLUGIN=true"
- plugins.security.ssl.http.enabled=false
- plugins.security.ssl.transport.enabled=false
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9200/_cluster/health"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- opensearch-data2:/usr/share/opensearch/data
expose:
- "9200"
- "9600"
networks:
- shared_network
opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:latest
container_name: opensearch-dashboards
expose:
- "5601"
environment:
OPENSEARCH_HOSTS: '["https://opensearch-node1:9200","https://opensearch-node2:9200"]'
networks:
- shared_network
ingest:
build:
context: . # Root directory
dockerfile: opensearch/Dockerfile
container_name: ingest-container
env_file:
- ./.env
environment:
- "DISABLE_SECURITY_PLUGIN=true"
- plugins.security.ssl.http.enabled=false
- plugins.security.ssl.transport.enabled=false
networks:
- shared_network
depends_on:
opensearch-node1:
condition: service_healthy
opensearch-node2:
condition: service_healthy
volumes:
- ~/.aws:/root/.aws:ro
command: ["/bin/sh", "-c", "while true; do sleep 30; done"]
queries:
build:
context: .
dockerfile: queries/Dockerfile
container_name: queries-container
env_file:
- ./.env
environment:
- PYTHONPATH=/app
networks:
- shared_network
depends_on:
db:
condition: service_healthy
opensearch-node1:
condition: service_healthy
opensearch-node2:
condition: service_healthy
volumes:
- .:/app
- ~/.aws:/root/.aws:ro
working_dir: /app/queries
entrypoint: ["tail", "-f", "/dev/null"]
volumes:
postgres_data:
opensearch-data1:
opensearch-data2:
networks:
shared_network:
name: shared_network
driver: bridge