Mintplex-Labs / anything-llm

The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, and more.
https://anythingllm.com
MIT License
26.52k stars 2.65k forks source link

Docker composer can not build the image using official steps #299

Closed franciscopaniskaseker closed 1 year ago

franciscopaniskaseker commented 1 year ago

I am following this doc: https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/HOW_TO_USE_DOCKER.md

about the step: yarn setup Not sure if is asking to setup yarn or to execute yarn setup in the root directory. i did both:

apt -y install yarn
root@:~/anything-llm# yarn setup
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'setup'

Then I tried to build:

root@:~/anything-llm/docker# docker-compose up -d --build
ERROR: The Compose file './docker-compose.yml' is invalid because:
'name' does not match any of the regexes: '^x-'

You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

i did the clone today, so the first lines of composer files are:

version: '3.9'

name: anythingllm

So i removed the line "name" and did:

export COMPOSE_PROJECT_NAME=anythingllm
docker-compose up -d --build

and the bulding process started to work.

Seems that the docker situation is something related with composer version, I am not sure. What I am sure is folowing the official steps to build the image will not work (at least with recent docker composer version).

timothycarambat commented 1 year ago

What version of docker-compose are you running? docker-compose -v

Locally I'm on Docker Compose version v2.10.2

timothycarambat commented 1 year ago

For the yarn command you are running the setup command in the root package.json. So the expanded command is yarn run setup while in the project root.

timothycarambat commented 1 year ago

Additionally, are you sure you installed yarn and not cmdtest See how to fix: https://github.com/yarnpkg/yarn/issues/3708#issuecomment-317358958

franciscopaniskaseker commented 1 year ago
root@ip-172-31-47-141:~# docker-compose -v
docker-compose version 1.29.2, build unknown

however, at the same time, the plugin version is: docker-compose-plugin is already the newest version (2.21.0-1~ubuntu.22.04~jammy).

For the yarn command you are running the setup command in the root package.json. So the expanded command is yarn run setup while in the project root.

root@:~/anything-llm# yarn run setup
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run'

Additionally, are you sure you installed yarn and not cmdtest

Not sure how to test if is cmdtest or not. what I did, then:

apt remove yarn cmdtest
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn

these are official steps from yarn official site.

then I tried:

root@:~/anything-llm# yarn run setup
yarn run v1.22.19
error anything-llm@0.2.0: The engine "node" is incompatible with this module. Expected version ">=18". Got "12.22.9"
error Commands cannot run with an incompatible environment.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

So seems that cmdtest was installed. Now i need to upgrade the node version:

apt install npm
npm install -g n
n latest

root@:~/anything-llm# node --version
v21.1.0

Now the command yarn run setup

executed as expected. Now I build the docker image again and seems that worked. I will try to use.

bryceartstew commented 1 year ago

I encountered the same issue, what was your exact fix?

I receive this error when I attempt to build the docker

ERROR: The Compose file './docker-compose.yml' is invalid because: 'project-name' does not match any of the regexes: '^x-'

You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1. For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

timothycarambat commented 1 year ago

@bryceartstew I was going to close this thread, but in general - that issue sounds like your install of docker-compose is not able to read the specific YAML we have defined. So I would start there if the Dockerfile cannot even be parsed!

franciscopaniskaseker commented 1 year ago

@bryceartstew i removed that line and did: export COMPOSE_PROJECT_NAME=anythingllm

franciscopaniskaseker commented 1 year ago

After correctly image build process (according official steps), we still can not use the anythingllm: Screenshot 2023-10-30 at 09 03 15

For now the dev will stop to try anythingllm. Too much problems. we expect something easier from docker image. thank you all.

timothycarambat commented 1 year ago

For what it's worth, it's because you have incorrect permissions on the database file in the host machine and docker cannot write to it from its process. If that cant be debugged I'm sorry and we will work to improve our docker install