fireproofsocks
Is it possible to customize the location of the priv/ directory? From what I understand, this is part of the OTP directory structure, so it may be hard-coded out of necessity. There are some cases (particularly when code interacts with other languages e.g. NodeJS) when it would be helpful to be able to configure the location of static assets to be somewhere other than priv/. I’ve had some success using the overlays option with releases, but it’s not quite the same as having the assurance that an entire directory will exist in a predictable place.
Can anyone shed some light on this? TIA!
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
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
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
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 new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
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
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
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
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Eiji
This is more
Erlang-related question thanElixir. On one hand having a path to some directory in let’s say environment variable is good idea.Elixiron its own is flexible and does not force much things like many languages/frameworks. However it’s based onErlangand this is a bit different story.Both
lib_dirandpriv_dirfunctions are essential inErlangand trying to changingprivpath may cause unexpected problems. Alsoprivfiles are usually packages into release, so even if it would be in different directory on dev/build machine then you would need to alter the packaging logic, so the files would be extracted in another location onprodmachine.Other solutions may also have their own downsides. Symbolic links may work without any problem or be not supported at all. The biggest problem here would be for example an existing symbolic link to not existing path. Creating directory would not work as same as without symlink.
Also have in mind that in
privdirectory there could be much more files than justassets. Trying to changeprivlocation at least in long term perspective seems not worth the effort.However that’s not all options we have, right?
Elixiris flexible, so let’s try find something onElixirside that works better in your use case … I would go in a bit different way of thinking. I see 2 options:Add a code which at runtime, right after application starts, changes some configuration files. That should be simple to do and this way other applications do not need to worry about paths as all of them could simply fetch a value of environment variable.
Plug.Static-based solution - ifassetsare all you need then you should be fine with theplug’s flexibility.This way allows not only to specify a different location for each environment, but also it’s easy to add checks and fall back just in case something bad would happen. That’s said … since it happens on
runtimeit could (but not need) to increase a response time …