mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 10:49:00 +00:00 
			
		
		
		
	Creating an image for elasticsearch-setup to automatically create indices
This commit is contained in:
		
							parent
							
								
									430f13108d
								
							
						
					
					
						commit
						1a3ddff4a4
					
				
							
								
								
									
										17
									
								
								docker/elasticsearch/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								docker/elasticsearch/Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | |||||||
|  | FROM openjdk:8 | ||||||
|  | 
 | ||||||
|  | MAINTAINER Kerem Sahin <ksahin@linkedin.com> | ||||||
|  | 
 | ||||||
|  | RUN apt-get update && apt-get install -y wget && apt-get install -y curl | ||||||
|  | 
 | ||||||
|  | COPY corpuser-index-config.json dataset-index-config.json / | ||||||
|  | 
 | ||||||
|  | ENV DOCKERIZE_VERSION v0.6.1 | ||||||
|  | RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||||||
|  |     && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||||||
|  |     && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | ||||||
|  | 
 | ||||||
|  | CMD dockerize -wait http://$ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT \ | ||||||
|  |             -timeout 60s; \ | ||||||
|  |             curl -XPUT $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/corpuserinfodocument --data @corpuser-index-config.json; \ | ||||||
|  |             curl -XPUT $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/datasetdocument --data @dataset-index-config.json | ||||||
| @ -20,6 +20,18 @@ services: | |||||||
|     depends_on: |     depends_on: | ||||||
|       - elasticsearch |       - elasticsearch | ||||||
| 
 | 
 | ||||||
|  |   # This "container" is a workaround to pre-create search indices | ||||||
|  |   elasticsearch-setup: | ||||||
|  |     build: | ||||||
|  |       context: . | ||||||
|  |     hostname: elasticsearch-setup | ||||||
|  |     container_name: elasticsearch-setup | ||||||
|  |     depends_on: | ||||||
|  |       - elasticsearch | ||||||
|  |     environment: | ||||||
|  |       - ELASTICSEARCH_HOST=elasticsearch | ||||||
|  |       - ELASTICSEARCH_PORT=9200 | ||||||
|  | 
 | ||||||
| networks: | networks: | ||||||
|   default: |   default: | ||||||
|     name: datahub_network |     name: datahub_network | ||||||
| @ -1,2 +0,0 @@ | |||||||
| curl -XPUT localhost:9200/corpuserinfodocument --data @corpuser-index-config.json |  | ||||||
| curl -XPUT localhost:9200/datasetdocument --data @dataset-index-config.json |  | ||||||
| @ -109,6 +109,18 @@ services: | |||||||
|     depends_on: |     depends_on: | ||||||
|       - elasticsearch |       - elasticsearch | ||||||
| 
 | 
 | ||||||
|  |   # This "container" is a workaround to pre-create search indices | ||||||
|  |   elasticsearch-setup: | ||||||
|  |     build: | ||||||
|  |       context: ../elasticsearch | ||||||
|  |     hostname: elasticsearch-setup | ||||||
|  |     container_name: elasticsearch-setup | ||||||
|  |     depends_on: | ||||||
|  |       - elasticsearch | ||||||
|  |     environment: | ||||||
|  |       - ELASTICSEARCH_HOST=elasticsearch | ||||||
|  |       - ELASTICSEARCH_PORT=9200 | ||||||
|  | 
 | ||||||
|   datahub-gms: |   datahub-gms: | ||||||
|     image: keremsahin/datahub-gms:latest |     image: keremsahin/datahub-gms:latest | ||||||
|     hostname: datahub-gms |     hostname: datahub-gms | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Kerem Sahin
						Kerem Sahin