https://promptfoo.dev/ logo
promptfoo view inside a container
# ❓|questions
u
I created my docker file where I take all of the promptfoo source code and it put in a docker container and do npm install and npm link, when I port forward to 15500, I keep running into Cannot GET / 404, is there something that I missing. The reason why I want to build it is to add custom functionality for our work.
i
Are you trying to run the CLI itself in the docker container?
If you're just hosting the webui, see instructions here:
u
Im using the cli in the container
i
Can you show me your dockerfile?
u
This is the dockerfile and the entrypoint: I am currently using view and npm run local:web as I run into a Cannot Get / error when just having the promptfoo view server up and running. The npm run local:web is unreliable and mostly of the time I run into issues with fetching: - error Failed to handle request for / TypeError: fetch failed at Object.fetch (/usr/src/app/src/web/nextui/node_modules/next/dist/compiled/undici/index.js:1:26669) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async invokeRequest (/usr/src/app/src/web/nextui/node_modules/next/dist/server/lib/server-ipc/invoke-request.js:21:12) at async requestHandler (/usr/src/app/src/web/nextui/node_modules/next/dist/server/lib/start-server.js:336:33) at async Server. (/usr/src/app/src/web/nextui/node_modules/next/dist/server/lib/start-server.js:152:13) { cause: Error: connect ECONNREFUSED 127.0.0.1:44845 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 44845 } } https://cdn.discordapp.com/attachments/1225177260735201363/1227696224560353390/Dockerfile.basic?ex=66295835&is=6616e335&hm=8477c441b813efe5e563dd85d7f0504147fca644131a1a8e3f69d2ce6f17f25f& https://cdn.discordapp.com/attachments/1225177260735201363/1227696224887636060/entrypoint.sh?ex=66295835&is=6616e335&hm=ff521a0b9d91086c37477e974b0044f5d85ac80ccd11a5bcbfcb3cc147ab8bf6&
i
The attachments don't seem to be openable on discord 😦 I would try
npm install promptfoo
and use
promptfoo view
directly, rather than clone and
npm run local:web
DockerFile: FROM node:16 WORKDIR /usr/src/app COPY . . RUN npm install RUN npm install -g node-fetch@2 RUN npm link ENV NEXT_PUBLIC_SUPABASE_URL=http:// ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=abc COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT: promptfoo view & npm run local:web & wait
2 Views