Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docker-compose): command format incorrect, postgres not fixed #161

Merged
merged 2 commits into from
Jul 15, 2023

Conversation

nekomeowww
Copy link
Owner

No description provided.

@nekomeowww
Copy link
Owner Author

@PA733 拜托看一下这个 PR,之前的没有完全修复

@nekomeowww
Copy link
Owner Author

@Garfield550 也许橘橘可以帮忙测试一下,我这边测试下来没有什么问题了

@PA733
Copy link
Contributor

PA733 commented Jul 15, 2023

抱歉,我在portainer上试的,没在docker-compose模块里面尝试

@nekomeowww
Copy link
Owner Author

抱歉,我在portainer上试的,没在docker-compose模块里面尝试

了解了,那我放 portainer 里面试试看w

healthcheck:
test: [ "CMD-SHELL", "redis-cli -e ${REDIS_PASSWORD:+-a \"$REDIS_PASSWORD\"} --no-auth-warning ping" ]
test: [ "CMD-SHELL", "redis-cli -a $$REDIS_PASSWORD --no-auth-warning ping" ]
Copy link
Contributor

@PA733 PA733 Jul 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前的改动考虑到了空密码和密码含空格的情况。
如果指定了--requirepass "",那么redis将会被锁死(任何登录操作,redis都会返回NOAUTH Authentication required信息)。
之前的逻辑是,密码为空时不传入--requirepass参数。

-e让认证失败或ping失败时,redis-cli返回非零状态码,这样docker就能正确捕获异常。

--no-auth-warning去掉了在命令行传入密码时,redis-cli的警告信息

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔️ 确实没想过这种情况,谢谢指出,那我修正一下

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改回去了,可以再看看

@nekomeowww nekomeowww requested a review from PA733 July 15, 2023 07:24
Copy link
Contributor

@PA733 PA733 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在shell和portainer上都测试了一遍,都正常了🥳

@nekomeowww nekomeowww merged commit 3384018 into main Jul 15, 2023
4 checks passed
@nekomeowww nekomeowww deleted the dev/fix-docker-compose branch July 15, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants