1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

生成AIに関する記事を書こう!
Qiita Engineer Festa20242024年7月17日まで開催中!

MacのDockerでdifyを起動するとpermission deniedになるときの対処

Last updated at Posted at 2024-07-06

MacでDifyを試してみようとして、docker compose upしたらログにpermission deniedと出力されて使用できない方はこの記事に書いてあることを試してみてください。

UIDとGIDを確認

先にidコマンドを実行してユーザーID(UID)とグループID(GID)を取得します。

$ id -u
100
$ id -g
50

docker/docker-compose.yamlを修正

docker/docker-compose.yamlを開き、api:worker:db:redis:weaviate:の直後にuser: "100:50"を記入します。

100の部分はUID、50の部分はGIDです。

diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
index d94753230..77d0f7a7a 100644
--- a/docker/docker-compose.yaml
+++ b/docker/docker-compose.yaml
@@ -161,6 +161,7 @@ x-shared-env: &shared-api-worker-env
 services:
   # API service
   api:
+    user: "100:50"
     image: langgenius/dify-api:0.6.12-fix1
     restart: always
     environment:
@@ -181,6 +182,7 @@ services:
   # worker service
   # The Celery worker for processing the queue.
   worker:
+    user: "100:50"
     image: langgenius/dify-api:0.6.12-fix1
     restart: always
     environment:
@@ -209,6 +211,7 @@ services:
 
   # The postgres database.
   db:
+    user: "100:50"
     image: postgres:15-alpine
     restart: always
     environment:
@@ -226,6 +229,7 @@ services:
 
   # The redis cache.
   redis:
+    user: "100:50"
     image: redis:6-alpine
     restart: always
     volumes:
@@ -314,6 +318,7 @@ services:
 
   # The Weaviate vector store.
   weaviate:
+    user: "100:50"
     image: semitechnologies/weaviate:1.19.0
     profiles:
       - ''

起動できるか確認

docker compose upして起動してみましょう。

Webブラウザでhttp://localhostを開くとDifyが表示されると思います。

参考にした issue

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?