feat: 增加单独的Elasticsearch扫描

This commit is contained in:
ZacharyZcR
2024-12-22 02:31:56 +08:00
parent 2e3ccee2e0
commit 8be8f94d82
7 changed files with 137 additions and 5 deletions
+19
View File
@@ -0,0 +1,19 @@
FROM docker.elastic.co/elasticsearch/elasticsearch:7.9.3
# 设置环境变量允许单节点运行
ENV discovery.type=single-node
# 允许任意IP访问
ENV network.host=0.0.0.0
# 设置弱密码
ENV ELASTIC_PASSWORD=elastic123
# 暴露端口
EXPOSE 9200 9300
# 设置默认用户名elastic和密码elastic123
RUN echo 'elastic:elastic123' > /usr/share/elasticsearch/config/users
# 关闭xpack安全功能,使其可以无认证访问
RUN echo 'xpack.security.enabled: false' >> /usr/share/elasticsearch/config/elasticsearch.yml
+2
View File
@@ -0,0 +1,2 @@
docker build -t elastic-test .
docker run -d -p 9200:9200 -p 9300:9300 elastic-test