Release (phx runner) docker image: Is there any guide or blog post that shows the expected file structure?

Hi Folks,
I’d like some help please.

I’m trying to build and debug a docker image used to deploy and run a phoenix app.
Is there any guide or block post that shows the expected structure for the files in the docker image used to run the phoenix app? For example, where should static assets end up?–If I have an image that is loaded from /images/ on my dev instance, where should the /images/ folder be in the docker image?

I’d like to be able to connect to my running docker image and see that everything ended up in the correct locations, and if not, I can go back to the Dockerfile and update the instructions for copying files from the phx-builder container to the phx-runner container.

I can’t seem to find detailed info on what to expect where in the phx-runner container to even check that the files are in the right locations.

Phoenix: 1.7, Elixir: 1.15.4, OPT:26

Most of the answer you’re looking for is completely unrelated to docker. The docker image builds an otp release, which as you noted has a different folder structure than a mix project. You can find it documented in the erlang docs: Erlang -- Releases

You’d need to look for /app (docker) ./lib/myapp-vsn/ (release) ./priv/static/… (phoenix static assets)

@LostKobrakai Thanks for the resources and info. I agree, this is not docker-specific, but has more to do with expectations around phoenix releases.
So for a concrete example, if I had logo.png that the HTML of the released phx site tries to load from /images/logo.png, where could I look to see where (on the file system) that should live?
Should that be here: /app/priv/static/images/logo.png
Is the expected location configured somewhere? Is it established by convention? I’m just wondering how to determine, definitively, where these files should exist in the context of a production release.
I apologize if this is a stupid question about well known info, I am having a challenge tracking down the info (most likely due to my lack of expertise related to phoenix releases).

For anyone following along, I found this mix release Directory structure in the mix release documentation, which help a lot:
https://hexdocs.pm/mix/Mix.Tasks.Release.html#module-directory-structure

So if I want to have my logo file load from “/images/logo.png” with app: my_app, and version: 1.0.0 (specified in mix.exs)

For my example of the images folder, it seems to work if I copy the logo.png image to /app/lib/my_app-1.0.0/priv/static/images then in HTML in the app, loading from “/images/logo.png” seems to work.

The latest issue seems to be that the .css file build during the prod asset build phase includes tailwinds but not the additional styles that I had put into static/assets/app.css

Does anyone know what I might be doing wrong?

Tailwind and I think esbuild though I’ve lost track of which does it, translates your assets/ file and builds the output to priv/static/. If you’re updating the static location then the build process is going to output a new file on top of it. You need to add your changes to the source essentially, not the output.

I’ve tested some things to get more info.

  1. I can build and run prod on my m1 Mac and it works (the assets get loaded: tailwinds + my custom app.css styles) – this made me wonder if there is an issue with my build on intel linux
  2. I setup an intel VM on an intel server, and in that VM I can build and run dev and prod–same as the m1 Mac…the assets get loaded correctly.
  3. For the docker build, I removed just about everything from .dockerignore (I kept .dockerignore, the ignore git section, and the era_crash.dump)

So now I’m down to either a) an issue building in the docker container, or b) an issue copying the build assets from the docker phx_builder container to the docker phx_runner container.

I suspect b but I still am not 100% sure what files need to be copied from the phx_builder container, and where, exactly, they should go in the phx_runner container.
It would help to get a very detailed step-by step on what is build (e.g. when tailwinds + app.css are combined and minimized, where does that end up?

Would someone please be able to provide a few more explicit details on the asset build process, and where (for example) the final app.css should end up after the build, and where I should put it in the phx_runner container (or please point me to the best place in the documentation–my problem is that the documentation does not go down to the detailed file-by-file level, so I still feel like I don’t know exactly what to check to verify the correct operation).

Any help or suggestions would be greatly appreciated!!