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

docker-compose.yml mysql should not expose 3306 port #5

Closed
MinoLiu opened this issue May 5, 2020 · 1 comment
Closed

docker-compose.yml mysql should not expose 3306 port #5

MinoLiu opened this issue May 5, 2020 · 1 comment

Comments

@MinoLiu
Copy link
Contributor

MinoLiu commented May 5, 2020

Hello
目前的yml是把mysql映射到主機3306 port上
因此主機是public IP的話 有很大的機會受到攻擊
可以把ports(L5-L6)刪掉, 只要config的host是使用mysql容器名稱連接就不會有問題

mysql:
image: mariadb:10.4.12
ports:
- 3306:3306
command: --character-set-server=utf8mb4
volumes:
- ./mysql/data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: e5sub
restart: always
container_name: mysql

@iyear
Copy link
Owner

iyear commented May 22, 2020

刚回家现在才合并,感谢!

@iyear iyear closed this as completed May 22, 2020
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

No branches or pull requests

2 participants