sashaafm
I’m trying to build a release of a project I’m working on which has several CSV, JSON and ETS files. There files are used at runtime to import ETS tables and at compile-time to dynamically generate certain modules. However, Distillery does not seem to include them in the release.
At the beginning I had them in a directory inside the Elixir project (alongside lib). I also tried moving the files inside the lib dir (and changing the config accordingly) but the results were the same.
I’ve been reading the docs but don’t find anything about this. There’s the following reference:
- code_paths (list of strings);
a list of additional code paths to use when searching
for applications/modules
but it does not seem to be related to extra needed files.
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
michalmuskala
The traditional place to put non-code resources that are needed at runtime is the
privfolder. All the tools are aware of this convention and preserve proper paths.You can access the files at runtime using
Application.app_dir(app_name, "priv/path/to/file")sashaafm
Thank you @michalmuskala. I’m going to try this and report back!
EDIT: Michal’s answer does work. Marking it as the solution.
bitwalker
You can use
:code.priv_dir(app)to get the priv directory directly as well, it’s what I typically use in my applications.chensan
How can I access the
privpath indev.exsfile? When I do it as below:I got:
I’m setting
ssl_optsfor Ecto, putting those pem files underpriv/ssl, but the application can’t access them after building with Distillery.Qqwy
Quick question about this: Does this directory stay the same for all releases, or will each new version have its own
priv_dir?OvermindDL1
As long as you install each release into the same directory then the
privdirectory ‘should’ always remain the same (unless using a custom OTP build or so).bitwalker
New versions of your application will have a slightly different path (as the path includes the version of your app in a release), but the same version will always be the same path, regardless of OTP version, Elixir version, etc.
Qqwy
Thank you. This has tripped me off before. I stored some general app-state-information in a file (because the database would be ridiculously overkill for this), but it turned out that the file was not found after upgrading my release, with the app thus restarting with a blank slate every time after an upgrade.
bitwalker
Yeah my general advice along these lines is to use
privfor anything version-specific and/or static data/assets and to rely on something more well-known of your own creation in the filesystem for stateful data, i.e./var/myapp/. You could also use thevardirectory created by the release, which you can obtain via theRELEASE_MUTABLE_DIRenvironment variable exposed to the release (which is used for temporary files like pipes, generated configs, and log files). That said, I would still tend towards using a directory like/var/myappmyself, since you can avoid clutter and manage it’s permissions and so on separately.acrogenesis
I’m having the same problem as @chensan I’m trying to set some ssl_opts in a config file and it says:
The app is named
:appin mix.exs