Skip to content

Commit 1c4a43e

Browse files
authored
Update secret.md
apache工作进程是www-data用户运行,而密钥文件(/run/secrets/wp_db_password)的属主是root,导致apache工作进程无法读取密钥,从而无法连接数据库
1 parent 7014e4d commit 1c4a43e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

swarm_mode/secret.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ $ docker service create \
6262
--network mysql_private \
6363
--publish target=30000,port=80 \
6464
--mount type=volume,source=wpdata,destination=/var/www/html \
65-
--secret source=mysql_password,target=wp_db_password,mode=0400 \
65+
--secret source=mysql_password,target=wp_db_password,mode=0444 \
6666
-e WORDPRESS_DB_USER="wordpress" \
6767
-e WORDPRESS_DB_PASSWORD_FILE="/run/secrets/wp_db_password" \
6868
-e WORDPRESS_DB_HOST="mysql:3306" \

0 commit comments

Comments
 (0)