feat: 添加Mongodb测试靶场

This commit is contained in:
ZacharyZcR 2024-12-20 19:53:20 +08:00
parent c7b6e21d39
commit 878595e341
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# 使用MongoDB官方镜像
FROM mongo:latest
# 设置环境变量
ENV MONGO_INITDB_ROOT_USERNAME=admin
ENV MONGO_INITDB_ROOT_PASSWORD=123456
# 开放27017端口
EXPOSE 27017
# 健康检查
HEALTHCHECK --interval=30s --timeout=3s \
CMD mongosh --eval 'db.runCommand("ping").ok' localhost:27017/test --quiet

View File

@ -0,0 +1,5 @@
docker build -t mongodb-server .
docker run -d \
-p 27017:27017 \
--name mongodb-container \
mongodb-server