Docker Build And Distillery

I am using edeliver with distillery to package my release. Everything is working great except I’m trying to get an EEX template for emailing and I get an error that the file cannot be found on my production server (but the error references my build server).

My production app lives at /home/pushers/app_release and builds at /home/builder/app_build

The error is this:

{%File.Error{action: “read file”, path: “/home/builder/app_build/_build/prod/lib/ticket_agent/priv/email_templates/tickets_pdf.html.eex”, reason: :enoent}

I figure I’m referencing the private templates incorrectly by doing this:

Application.app_dir(:ticket_agent, "priv/email_templates") <> "/tickets_pdf.html.eex"

Is there a better way to do this? How can I get it to reference the production app path, not the build path?

How can I get it to reference the production app path, not the build path?

Maybe make the paths on the build and production machines the same?

Or use a function that is more dynamic than Application.app_dir.

(Not sure if that would work any differently than Application.app_dir)

priv_dir = to_string(:code.priv_dir(:ticket_agent))
Path.join([priv_dir, "email_templates", "tickets_pdf.html.eex"])

I usually do:
Path.absname("priv/somefolder/" <> Atom.to_string(domain) <> ".json", Application.app_dir(:your_app))