No output when dockerizing a phoenix application

Hello

Im trying to dockerize a phoenix liveview application.
I have used the docker file generated with mix phx.gen.release --docker with one small edition as I need to deal with tailwindcss.
See full dockerfile here.

The docker build completes successfully, but I get no output when running the container.
The only output I get is if I shut down the postgres container, then it complains about not being able to connect to the database.
Otherwise no output in the console, and the webpage doesnt load.
Im using docker compose to run the database and the app. See here for the whole thing.

Im really scratching my head here.
Not sure what else to try.

Thanks!

1 Like

Huh. It seems fine… I have, in my docker-compose.yml, one extra param tty: true but that cannot be.
Can you try and get into the container i.e. docker-compose run --rm service ash/bash/etc and then try to run phoenix? Perhaps there is no output for some weird reason.

It does seem to be running.
Output from top:

   1 nobody    20   0 2656512 189744  85552 S   0.7   9.3   0:04.55 beam.smp
   38 nobody    20   0       0      0      0 Z   0.0   0.0   0:00.00 epmd
   39 nobody    20   0    3656     84      0 S   0.0   0.0   0:00.00 epmd
   43 nobody    20   0    2308    568    508 S   0.0   0.0   0:00.00 erl_child_setup
   66 nobody    20   0    3652    896    816 S   0.0   0.0   0:00.00 inet_gethost
   67 nobody    20   0    3868   1880   1740 S   0.0   0.1   0:00.00 inet_gethost
   68 nobody    20   0    2420    580    512 S   0.0   0.0   0:00.03 sh
   74 nobody    20   0    9912   3760   3244 R   0.0   0.2   0:00.00 top

i can also access the running beam via the remote command on the binary.

I tried it with a fresh phoenix project, and it works.
There must be something in the project I am building that is breaking it.

1 Like

gotta be, makes no sense to me.

It seems the issue was related to the version of Phoenix and LiveView that was being used.
After porting all the code to a new updated Phoenix application it now works.
The only remaining issue is that when loading the site my assets dont seem to be loading:

phoenix_1  | 07:26:11.933 request_id=FsnDwMlp9sGDblEAAAOj [info] GET /css/app.css
phoenix_1  | 07:26:11.934 request_id=FsnDwMlp9sGDblEAAAOj [info] Sent 404 in 333µs
phoenix_1  | 07:26:11.937 request_id=FsnDwMmiGr9z2WwAAAPD [info] GET /js/app.js
phoenix_1  | 07:26:11.937 request_id=FsnDwMmiGr9z2WwAAAPD [info] Sent 404 in 196µs

Doesnt seem to be affecting anything though as far as I can tell.
Any ideas?

1 Like

hmm if you try to enter to the container, again, and with the terminal session curl the asset, do you get it? i mean obviously run the phoenix server first.