Docker container starts the Phoenix server and serves a static HTML file at localhost:4000
Docker container starts and does serve the file correctly, but it gets Killed within a minute or so. This happens regardless of activity.
Steps to reproduce the behavior
- mix phoenix.new --no-brunch --no-ecto hello_phoenix
- cd hello_phoenix
- (Copy Dockerfile)
- docker build -t hello_phoenix .
- docker run -p 4000:4000 hello_phoenix
docker inspect (container name) shows me that the process exits with a 137 error code. If you add a -m flag to the run command, you can adjust how long it takes for it to crash. What is odd is that if, for example, you do -m=3g, the container will exit with “OOMKill” set to true even though no process actually approaches 3GB of memory in the process explorer. This all makes me think there’s an issue with the Phoenix app, but it runs with no issue on my machine. Here’s the Dockerfile I’ve written:
RUN echo $PWD
ADD . ./
RUN yes | mix local.hex
RUN yes | mix deps.get
RUN yes | mix compile
RUN ls -l
ENTRYPOINT yes | MIX_ENV=dev mix phoenix.server
Is there any more info that would be helpful?