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

启动后localhost/install 页面不停的转圈,无法输入admin管理员密码。

日志报错如下:

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     | [GIN] 2024/12/25 - 02:13:48 | 200 |      27.609µs |             ::1 | GET      "/health"

1.在 dify/docker 文件夹下找到 docker-compose.yaml

2.找到文件夹中的 volumes/db/data ,替换为 postgres-data

3.最后在末尾,添加上 postgres-data

使用 docker compose up -d 启动容器

docker compose up -d 

输入 docker compose ps可以看到运行的服务

docker compose ps

浏览器上,输入 http://localhost即可访问

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值