吴旭华 发表于 2025-2-21 07:20:59

docker compose up -d后,docker-db-1 无法正常 Running,总是重启 Restart

https://i-blog.csdnimg.cn/direct/c507f6f5ddb4404fb1c4534077720fff.png
启动后localhost/install 页面不绝的转圈,无法输入admin管理员暗码。https://i-blog.csdnimg.cn/direct/6a38b9f3a2554e508a13d8ba0919b4bf.png
https://i-blog.csdnimg.cn/direct/020819bdb16f405f949c28b6813fec74.png
日志报错如下:
2024-12-25 10:11:46 db-1          | The files belonging to this database system will be owned by user "postgres".
2024-12-25 10:11:46 db-1          | This user must also own the server process.
2024-12-25 10:11:46 db-1          |
2024-12-25 10:11:46 db-1          | The database cluster will be initialized with locale "en_US.utf8".
2024-12-25 10:11:46 db-1          | The default database encoding has accordingly been set to "UTF8".
2024-12-25 10:11:46 db-1          | The default text search configuration will be set to "english".
2024-12-25 10:11:46 db-1          |
2024-12-25 10:11:46 db-1          | Data page checksums are disabled.
2024-12-25 10:11:46 db-1          |
2024-12-25 10:11:46 db-1          | initdb: error: could not change permissions of directory "/var/lib/postgresql/data/pgdata": Operation not permitted
2024-12-25 10:11:46 db-1          | fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... 2024-12-25T02:12:46.866162406Z chmod: /var/lib/postgresql/data/pgdata: Operation not permitted
2024-12-25 10:12:46 db-1          | The files belonging to this database system will be owned by user "postgres".
2024-12-25 10:12:46 db-1          | This user must also own the server process.
2024-12-25 10:12:46 db-1          |
2024-12-25 10:12:46 db-1          | The database cluster will be initialized with locale "en_US.utf8".
2024-12-25 10:12:46 db-1          | The default database encoding has accordingly been set to "UTF8".
2024-12-25 10:12:46 db-1          | The default text search configuration will be set to "english".
2024-12-25 10:12:46 db-1          |
2024-12-25 10:12:46 db-1          | Data page checksums are disabled.
2024-12-25 10:12:46 db-1          |
2024-12-25 10:12:46 db-1          | initdb: error: could not change permissions of directory "/var/lib/postgresql/data/pgdata": Operation not permitted
2024-12-25 10:12:46 db-1          | fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... 2024-12-25T02:13:47.405758077Z chmod: /var/lib/postgresql/data/pgdata: Operation not permitted
2024-12-25 10:13:47 db-1          | The files belonging to this database system will be owned by user "postgres".
2024-12-25 10:13:47 db-1          | This user must also own the server process.
2024-12-25 10:13:47 db-1          |
2024-12-25 10:13:47 db-1          | The database cluster will be initialized with locale "en_US.utf8".
2024-12-25 10:13:47 db-1          | The default database encoding has accordingly been set to "UTF8".
2024-12-25 10:13:47 db-1          | The default text search configuration will be set to "english".
2024-12-25 10:13:47 db-1          |
2024-12-25 10:13:47 db-1          | Data page checksums are disabled.
2024-12-25 10:13:47 db-1          |
2024-12-25 10:13:47 db-1          | initdb: error: could not change permissions of directory "/var/lib/postgresql/data/pgdata": Operation not permitted
2024-12-25 10:13:48 sandbox-1   | 2024/12/25 - 02:13:48 | 200 |      27.609µs |             ::1 | GET      "/health" 1.在 dify/docker 文件夹下找到 docker-compose.yaml
https://i-blog.csdnimg.cn/direct/4523774533f64791ac7619f1ed78c90d.png
2.找到文件夹中的 volumes/db/data ,更换为 postgres-data
https://i-blog.csdnimg.cn/direct/f54bf163783e4df8ac60acbded70ef14.png
3.最后在末尾,添加上 postgres-data
https://i-blog.csdnimg.cn/direct/365ceb998b294f29b9d871ae98cf2d7e.png
使用 docker compose up -d 启动容器
docker compose up -d 输入 docker compose ps可以看到运行的服务
docker compose ps
欣赏器上,输入 http://localhost即可访问

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: docker compose up -d后,docker-db-1 无法正常 Running,总是重启 Restart