-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
233 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
ES_VERSION=7.5.1 | ||
ES_VERSION=8.7.0 | ||
ELASTIC_PASSWORD=changeme |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
ARG ES_VERSION | ||
FROM docker.elastic.co/elasticsearch/elasticsearch:$ES_VERSION as builder | ||
|
||
USER root | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update -y && apt-get install -y software-properties-common build-essential | ||
RUN gcc --version | ||
RUN apt-get update -y && apt-get install -y make cmake pkg-config wget git | ||
|
||
ENV JAVA_HOME=/usr/share/elasticsearch/jdk | ||
ENV PATH=$JAVA_HOME/bin:$PATH | ||
|
||
# Build coccoc-tokenizer | ||
RUN echo "Build coccoc-tokenizer..." | ||
WORKDIR /tmp | ||
RUN git clone https://github.com/duydo/coccoc-tokenizer.git | ||
RUN mkdir /tmp/coccoc-tokenizer/build | ||
WORKDIR /tmp/coccoc-tokenizer/build | ||
RUN cmake -DBUILD_JAVA=1 .. | ||
RUN make install | ||
|
||
# Build analysis-vietnamese | ||
RUN echo "analysis-vietnamese..." | ||
WORKDIR /tmp | ||
RUN wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz \ | ||
&& tar xvf apache-maven-3.8.8-bin.tar.gz | ||
ENV MVN_HOME=/tmp/apache-maven-3.8.8 | ||
ENV PATH=$MVN_HOME/bin:$PATH | ||
|
||
COPY . /tmp/elasticsearch-analysis-vietnamese | ||
WORKDIR /tmp/elasticsearch-analysis-vietnamese | ||
RUN mvn verify clean --fail-never | ||
RUN mvn --batch-mode -Dmaven.test.skip -e package | ||
|
||
FROM docker.elastic.co/elasticsearch/elasticsearch:$ES_VERSION | ||
ARG ES_VERSION | ||
ARG COCCOC_INSTALL_PATH=/usr/local | ||
ARG COCCOC_DICT_PATH=$COCCOC_INSTALL_PATH/share/tokenizer/dicts | ||
|
||
COPY --from=builder $COCCOC_INSTALL_PATH/lib/libcoccoc_tokenizer_jni.so /usr/lib | ||
COPY --from=builder $COCCOC_DICT_PATH $COCCOC_DICT_PATH | ||
COPY --from=builder /tmp/elasticsearch-analysis-vietnamese/target/releases/elasticsearch-analysis-vietnamese-$ES_VERSION.zip / | ||
RUN echo "Y" | /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///elasticsearch-analysis-vietnamese-$ES_VERSION.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
version: '3.4' | ||
|
||
services: | ||
elasticsearch: | ||
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION} | ||
build: | ||
context: . | ||
args: | ||
ES_VERSION: ${ES_VERSION} | ||
restart: on-failure | ||
ports: | ||
- "9200:9200" | ||
volumes: | ||
- ./target/releases/elasticsearch-analysis-vietnamese-${ES_VERSION}.zip:/usr/share/elasticsearch/plugin/elasticsearch-analysis-vietnamese-${ES_VERSION}.zip | ||
- ./install-es-plugin.sh:/apps/install-es-plugin.sh | ||
ulimits: | ||
nofile: | ||
soft: 65536 | ||
hard: 65536 | ||
memlock: | ||
hard: -1 | ||
soft: -1 | ||
environment: | ||
- "ES_VERSION=${ES_VERSION}" | ||
- "discovery.type=single-node" | ||
entrypoint: | ||
- /apps/install-es-plugin.sh | ||
ES_JAVA_OPTS: "-Xmx2g -Xms2g" | ||
ELASTIC_USERNAME: "elastic" | ||
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD} | ||
bootstrap.memory_lock: "true" | ||
discovery.type: "single-node" | ||
xpack.security.enabled: "true" | ||
networks: | ||
- elastic | ||
|
||
networks: | ||
elastic: | ||
driver: bridge |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.