Open crbon opened 11 months ago
@crbon did you solve this? I'm running into the same issue.
@BrunoBernardino unfortunately I haven't worked it out, the issues is still present.
Thanks. I also tried npm:puppeteer
and ran into similar issues. I basically ended up switching to using wkhtmltopdf
since I was using puppeteer
to generate a PDF of an HTML document. I install the command in the docker machine and just call new Deno.Command('wkhtmltopdf', { args: ['file://<htmlFilePath>', '<pdfFilePath>'] });
from the code, now.
If anyone's curious, here's my Dockerfile
:
# wkhtmltopdf image needed to more quickly build bins
FROM surnet/alpine-wkhtmltopdf:3.19.0-0.12.6-full as wkhtmltopdf
FROM denoland/deno:alpine-1.39.3
# wkhtmltopdf install dependencies
RUN apk add --no-cache \
libstdc++ \
libx11 \
libxrender \
libxext \
libssl1.1 \
xvfb \
ca-certificates \
fontconfig \
freetype \
ttf-droid \
ttf-freefont \
ttf-liberation \
# more fonts
;
# wkhtmltopdf copy bins from ext image
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/libwkhtmltox.so /bin/
RUN ln -s /bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf;
RUN chmod +x /usr/local/bin/wkhtmltopdf;
EXPOSE 8000
# Prefer not to run as root.
USER deno
WORKDIR /app
# These steps will be re-run upon each file change in your working directory:
ADD . /app
# Compile the main app so that it doesn't need to be compiled each startup/entry.
RUN deno cache --reload main.ts
CMD ["run", "--allow-all", "main.ts"]
Not sure what I'm doing wrong, but can't seem to get deno-puppeteer working in docker. It works fine if I run the
deno --allow-all main.js
.Error
If I leave it running longer it'll give a timeout error.
Code snippet
Dockerfile