-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECONNREFUSED using Docker Container #256
Comments
I think because your base image was Puppeteer, it conflicted with this library somehow. |
Already tried with node base image and still gives me the same error |
@alescofet I meet the same issue and installing xvfb as node dependency fixed the problem. |
@alescofet set |
this problem should be fixed. Please let me know if it persists in the latest version. |
Description
When trying to navigate to a url it gives me this error:
Error: connect ECONNREFUSED 127.0.0.1:36957
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 36957
}
Full steps to reproduce the issue
This is my dockerfile:
FROM ghcr.io/puppeteer/puppeteer:22
USER root
RUN apt-get update &&
apt-get -y install sudo &&
adduser pptruser sudo &&
echo "pptruser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER root
RUN sudo apt-get update && apt-get install -y
wget
gnupg
ca-certificates
apt-transport-https
xvfb &&
rm -rf /var/lib/apt/lists/*
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&
echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list &&
apt-get update &&
apt-get install -y google-chrome-stable &&
rm -rf /var/lib/apt/lists/*
ENV PORT=5000
ENV MONGO_URI=
ENV ENV=prod
RUN mkdir -p /home/pptruser/Downloads /app &&
chown -R pptruser:pptruser /home/pptruser &&
chown -R pptruser:pptruser /app
USER pptruser
COPY package.json /app
RUN npm install
COPY . /app
EXPOSE 5000
ENTRYPOINT ["/usr/local/bin/node", "/app/server.js"]
And this is my script:
async function launchPuppeteer() {
const {browser,page} = await connect({
})
return {browser,page}
}
async function refreshLink(url) {
const Game = connectCollection('scrap-cd-romance', 'Game')
const {browser, page} = await launchPuppeteer()
await page.goto(url);
console.log(await page.content());
await page.click("button.acf-get-content-button");
await page.waitForSelector("#acf-content-wrapper a");
const html = await page.content();
}
Issue Type
Bug
Operating System
Linux
Do you use Docker?
Docker
The text was updated successfully, but these errors were encountered: