runyonave
Cannot get chromic_pdf to run in prod environment
We have been stuck on this for a few days now and I am really not sure what could be missing. I can get chromic_pdf to work perfectly fine on my dev environment. I.e. it can render and store PDFs from HTML without any issue.In terms of setting it up:
mix.exs:
{:chromic_pdf, "~> 1.17"}
runtime.exs
config :tailboard, :pdf, url: System.fetch_env!("APP_URL")
config :chromic_pdf,
chrome_executable: System.get_env("CHROME_PATH"),
discard_stderr: false,
chrome_args: [
"--no-sandbox",
"--disable-dev-shm-usage",
"--disable-gpu",
"--disable-setuid-sandbox",
"--disable-software-rasterizer",
"--enable-logging=stderr",
"--headless"
],
log_level: :info,
temp_dir: "/tmp/app"
application.exs
def start(_type, _args) do
TailboardWeb.AllowedAddressList.start()
# Define workers and child supervisors to be supervised
children = [
...other modules
ChromicPDF
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: Tailboard.Supervisor]
Supervisor.start_link(children, opts)
end
In Dockerfile I get these dependencies:
RUN apt-get update -y && \
apt-get install -y \
libstdc++6 openssl libncurses5 locales ca-certificates chromium \
libnss3 libfreetype6 libharfbuzz0b fonts-freefont-ttf imagemagick \
tini fontconfig curl \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
Is there anything I am missing?
First Post!
windexoriginal
Are you running Google Chrome rather than Chromium on your dev machine? Google Chrome is run from a different directory and started with a different command (“chrome” vs “chromium-browser”), which may be causing the issues in your container.
Popular in Troubleshooting
Hey there,
Using the install script method recommended here on Ubuntu 24.04:
And then running the following commands:
iex> :obser...
New
Hello everyone,
I’m working on a blockchain project in Elixir and I’m implementing some of the core cryptography in a Rust NIF using Rus...
New
Besides (over)logging every code-path leading to Repo.insert_all, is it possible to make Postgrex and/or ecto_sql log the exact, failing ...
New
I have installed it on Phoenix 1.8.1 (without authentication or other packages and got 2 problems).
I had to set up things manually the ...
New
In a project I’m working on, I cannot get tests with breakpoints or pry working. Here is an example in a new mix project.
Create a fresh...
New
I tried to learn Elixir a few years ago and stopped. I am trying again.
In the code below I have a GenServer that is started by a Superv...
New
I don’t get an error directly related to Paraxial, but removing that dependency stopped the crash.
Has anyone experienced a similar issu...
New
I am trying deploy phoenix app to cloud run every thing works locally fine using public IP but when i deployed to cloud run the app could...
New
Hello,
I’m trying to upgrade a pretty large project from Elixir 1.18.4 to Elixir 1.19.1 (1321 modules), but seeing some compiler warning...
New
We have been stuck on this for a few days now and I am really not sure what could be missing. I can get chromic_pdf to work perfectly fin...
New
Other popular topics
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
What is the idiomatic way of matching for not nil in Elixir?
E.g.,
First way:
defp halt_if_not_signed_in(conn, signed_in_account) when...
New
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this
"1000"
What is the ...
New
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: )
Hello all, this is ...
New







