ItzCrazyKns / Perplexica

Perplexica is an AI-powered search engine. It is an Open source alternative to Perplexity AI
MIT License
16.47k stars 1.54k forks source link

Docker compose fail at perplexica backend building stage at step yarn install #238

Closed jiafu83 closed 4 months ago

jiafu83 commented 4 months ago

Describe the bug I used the docker method try to build Perplexica, however everytime the build failed at backend building step 11 yarn install part, as showing below: image

To Reproduce Steps to reproduce the behavior:

  1. Use conda to build a fresh new enviroment, with python=3.11
  2. fresh clone Perplexica: git clone https://github.com/ItzCrazyKns/Perplexica.git
  3. go to Perplexica folder, and run: docker compose up -d
  4. See the similar error image

Additional context

  1. The system is ubuntu 22.04, with docker 27.0
  2. Actually I have yarn installed locally, and "yarn add sharp" locally is no problem, but when builds this, it fails, so confusing
akramer-zibra commented 4 months ago

Hey @jiafu83 . The master branch is the latest development version and so may contain issues. Try v1.7.0 from 4 days ago (https://github.com/ItzCrazyKns/Perplexica/releases/tag/v1.7.0). This version should build in the docker compose setup without issues.

Ed-cred commented 4 months ago

The sharp problem this is something specified in their documentation as being a problem regarding what the docker image and C compiler architecture that you use. For a quick fix, you can add the following line to your backend dockerfile.

RUN yarn add sharp --ignore-engines

This should solve the problem of sharp not knowing which type of compiler or architecture it is building for. For more information you can reference the sharp installation docs.

ItzCrazyKns commented 4 months ago

I'd recommend you to try the latest release, it should work as expected

jiafu83 commented 4 months ago

Thanks all your guys for invaluable help. Unfortunately I found it's not the perplexica code issue, either 1.7.0 or the latest one is OK, it's the mainland China network issue...After I add 'proxy' args for backend part in docker-compose.yaml, the build is smooth. Now I face the same issue as https://github.com/ItzCrazyKns/Perplexica/issues/180

hanjinxin commented 4 months ago

@jiafu83 哈喽 这个代理是vpn还是适合中国宝宝的镜像源呢