-
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.
Merge pull request #132 from scrapnode/feature/upgrade-to-es-8.x
upgrade: docker-compose with version 8.x
- Loading branch information
Showing
5 changed files
with
94 additions
and
19 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 @@ | ||
ES_VERSION=7.5.1 | ||
ES_VERSION=8.3.3 |
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,48 @@ | ||
ARG ES_VERSION=8.3.3 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# thanks to https://github.com/cpfriend1721994/docker-es-cococ-tokenizer | ||
FROM docker.elastic.co/elasticsearch/elasticsearch:$ES_VERSION as builder | ||
ARG ES_VERSION | ||
ARG DEBIAN_FRONTEND | ||
USER root | ||
|
||
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 openjdk-17-jdk | ||
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 | ||
|
||
RUN cd /tmp && 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 && \ | ||
mkdir -p /usr/share/maven && cd /usr/share/maven && \ | ||
cp -r /tmp/apache-maven-3.8.8/* . | ||
ENV PATH=/usr/share/maven/bin:$PATH | ||
|
||
WORKDIR / | ||
|
||
COPY pom.xml . | ||
RUN mvn verify clean --fail-never | ||
|
||
RUN git clone https://github.com/coccoc/coccoc-tokenizer.git | ||
|
||
RUN mkdir /coccoc-tokenizer/build | ||
WORKDIR /coccoc-tokenizer/build | ||
RUN cmake -DBUILD_JAVA=1 .. | ||
RUN make install | ||
|
||
COPY . /elasticsearch-analysis-vietnamese | ||
WORKDIR /elasticsearch-analysis-vietnamese | ||
RUN mvn package -Dmaven.test.skip -e | ||
|
||
FROM docker.elastic.co/elasticsearch/elasticsearch:$ES_VERSION | ||
ARG ES_VERSION | ||
|
||
COPY --from=builder /coccoc-tokenizer/dicts/tokenizer /usr/local/share/tokenizer/dicts | ||
COPY --from=builder /coccoc-tokenizer/dicts/vn_lang_tool /usr/local/share/tokenizer/dicts | ||
COPY --from=builder /coccoc-tokenizer/build/libcoccoc_tokenizer_jni.so /usr/lib | ||
COPY --from=builder /coccoc-tokenizer/build/multiterm_trie.dump /usr/local/share/tokenizer/dicts | ||
COPY --from=builder /coccoc-tokenizer/build/nontone_pair_freq_map.dump /usr/local/share/tokenizer/dicts | ||
COPY --from=builder /coccoc-tokenizer/build/syllable_trie.dump /usr/local/share/tokenizer/dicts | ||
COPY --from=builder /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,28 @@ | ||
version: '3.4' | ||
|
||
services: | ||
elasticsearch: | ||
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION} | ||
build: . | ||
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: changemenow | ||
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.