ahmadrosid / pdfpintar

Chat with PDF documents.
73 stars 14 forks source link

Docker does not build #11

Closed Hailot closed 3 weeks ago

Hailot commented 10 months ago

When running docker-compose up -d the command fails

Screenshot 2023-10-21 at 09 24 18
ahmadrosid commented 10 months ago

HI @Hailot have you try to run ziggy:generate?

php artisan ziggy:generate
Hailot commented 10 months ago

@ahmadrosid Would you add that to the dockerfile ?

Since the container isn't running I can't run that command manually

ahmadrosid commented 10 months ago

Yeah, feel free to open PR I am not available at the moment.

On Sat, Oct 21, 2023, 18:16 Hailot @.***> wrote:

@ahmadrosid https://github.com/ahmadrosid Would you add that to the dockerfile ?

Since the container isn't running I can't run that command manually

— Reply to this email directly, view it on GitHub https://github.com/ahmadrosid/pdfpintar/issues/11#issuecomment-1773759692, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHALJSDCPYBK5YEKLG33GNTYAOVHHAVCNFSM6AAAAAA6J6ZYWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZTG42TSNRZGI . You are receiving this because you were mentioned.Message ID: @.***>

spencerwongfeilong commented 10 months ago

Hello

It's still not building after the ziggy:generate has been added to the dockerfile.

image

MikeCraig418 commented 10 months ago

Hi @spencerwongfeilong -

I was able to get this working using Laravel Sail: https://github.com/ahmadrosid/pdfpintar/compare/main...yo-mike:pdfpintar:main

This uses Laravel Sail and compiles the libphp_pdf.so file from source. I'm also using another pgvector layer, which I just had in a previous sail project.

@ahmadrosid -- thanks for this project. It really is beautiful!

arndvs commented 10 months ago

I'm also unable to build in docker with the php artisan ziggy:generate

@yo-mike, I tried to build using your sail fork, but an into this issue in the build:

image

I'm not familuar with building in sail. Do I need to do anything additional to running the docker-compose up -d?

--edit--

I was able to get docker-compose up -d to work by adding WWWGROUP=1000 WWWUSER=1000 to the env, but the database migration docker-compose exec server php artisan migrate and the front end npm run dev are not working. Could you please update the readme file to the correct instructions? Thank you

ahmadrosid commented 10 months ago

Hi @arndvs what is the problem with Dockerfile from the source could you give me the error log for that?

spencerwongfeilong commented 9 months ago

Hi @arndvs what is the problem with Dockerfile from the source could you give me the error log for that?

This is the error that i gotten

image

ahmadrosid commented 9 months ago

Hi @spencerwongfeilong, it looks like there is a problem installing the node-canvas package on Windows. Try following the installation instructions here: https://github.com/Automattic/node-canvas/wiki/Installation:-Windows

spencerwongfeilong commented 9 months ago

Hi @spencerwongfeilong, it looks like there is a problem installing the node-canvas package on Windows. Try following the installation instructions here: https://github.com/Automattic/node-canvas/wiki/Installation:-Windows

Hello. I am on Ubuntu. I will try. Thank you.

ahmadrosid commented 9 months ago

Try this for ubuntu: https://github.com/Automattic/node-canvas/wiki/Installation:-Ubuntu-and-other-Debian-based-systems

spencerwongfeilong commented 9 months ago

Try this for ubuntu: https://github.com/Automattic/node-canvas/wiki/Installation:-Ubuntu-and-other-Debian-based-systems

Hello. Still not able to build after installing canvas.

root@xeonubuntu:/home/CONTAINERS/pdfpintar# docker-compose up -d Building server DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/buildx/

Sending build context to Docker daemon 11.5MB Step 1/16 : FROM node as builder ---> d7eb1d080096 Step 2/16 : RUN npm install --global pnpm ---> Using cache ---> dc12ca338e46 Step 3/16 : WORKDIR /app ---> Using cache ---> 2f49d279ea57 Step 4/16 : COPY . . ---> Using cache ---> 856306410084 Step 5/16 : RUN pnpm install ---> Using cache ---> 4b82bf8f31c6 Step 6/16 : RUN pnpm run build ---> Running in 8258cfe69f0c

@ build /app tsc && vite build && vite build --ssr

resources/js/ssr.tsx(5,19): error TS2307: Cannot find module '../../vendor/tightenco/ziggy/dist/index.m' or its corresponding type declarations.  ELIFECYCLE  Command failed with exit code 2. The command '/bin/sh -c pnpm run build' returned a non-zero code: 1 ERROR: Service 'server' failed to build : Build failed root@xeonubuntu:/home/CONTAINERS/pdfpintar#

ahmadrosid commented 9 months ago

Hi @spencerwongfeilong try to update your source code with this new changes: https://github.com/ahmadrosid/pdfpintar/pull/13

spencerwongfeilong commented 9 months ago

Hi @spencerwongfeilong try to update your source code with this new changes: #13

Hi. The progress got further but still did not build.

image

sdot257 commented 9 months ago

Same issue as @spencerwongfeilong I would love to try this out.

ahmadrosid commented 8 months ago

Hi all, sorry for the very, very late response. I've updated the Dockerfile and removed the php-pdf library. Now, you should be able to run docker-compose up with no issue.

spencerwongfeilong commented 8 months ago

Hello it does build successfully. But accessing the browser on 9000, in my case 9123, the web server does not load. It seems that the web server is not connected to the pgvector database.

Could you share your env?

ahmadrosid commented 8 months ago

Here's my env

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:wx+4HYSDe9biSPaqHfWdo2cAV5X1u7f4pwuglbG2Sjk=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=pgsql
DB_HOST=pgvector
DB_PORT=5432
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

BIN_PDF_TO_TEXT=/usr/bin/pdftotext
BIN_PDF_INFO=/usr/bin/pdfinfo

OPENAI_API_KEY=...
spencerwongfeilong commented 8 months ago

Hello. Still no dice. Other than docker compose up. Do we need more configuration?

I did execute the following command after docker compose.

docker compose exec server php artisan migrate

Maybe i should elaborate i am trying to access the ip:port from another network device.

ahmadrosid commented 8 months ago

Yeah that should be enough. It will run on port 80.

http://localhost:80
# or
http://localhost

If you are trying to access it from other device you should be using your IP no need to define port just the ip.

spencerwongfeilong commented 8 months ago

Hello i still can't access the front end.

Here are my observations. I think you made a mistake in the file path for the database directory. database:/var/lib/pgsql/data:rw It should be database:/var/lib/posgresql/data:rw i think?

Also when i manually set my file path on the host for the posgresql data path, i saw in winscp that the directory owner is Ixd instead of my own user account (administrator). Not sure if i am doing it correctly.

ahmadrosid commented 3 weeks ago

Hi everyone! I just wanted to give you all an update: this project has been refactored to be simpler. There are no more complicated steps to install. Please check the new readme for installation steps. 🙏

ahmadrosid commented 3 weeks ago

I am closing this issue now.