So just remove from your Dockerfile:
COPY . /phoenix
EXPOSE 4000
Add this:
WORKDIR /app
and fix your docker compose volume to:
- $PWD:/app
But his is running as root, and that is not good from a security point of view.
With this changes you don’t need to rebuild your image each time you change files in the host.
Just add inotify tools to the container and host OS and change the max number of files he can watch, and you are good to go.
#!/bin/sh
set -eu
Main()
{
apt install -y -q --no-install-recommends \
procps \
inotify-tools
printf "fs.inotify.max_user_watches=524288\n" > /etc/sysctl.d/01-inotify.conf
}
Main
I use this for years without any problems.
I am working on an Elixir Docker Stack that just makes everything a breeze, but not yet ready for others to try because the base image is not yet released in Docker Hub, therefore you cannot try it in your computer.






















