- Initially, only the docker-compose.yml and Dockerfile exist.
- Run
docker-compose run --build app bash
to build the image, run the container, and open a bash shell in the container. - Run
mix phx.new . --app phoenix_photo_tagger --no-live
to create a new Phoenix project. - Edit database hostname and http ip in config/dev.exs to get working in docker container.
- Run
mix ecto.create
to setup connection to database. - Run
mix local.hex --force
to initialize package manager. - Exit the docker container, and run
sudo chown -R $USER:$USER ./app
to change ownership of the files by scripts run in docker (which runs as root by default). This allows saving the files in vscode. - To run further mix commands in server (like ecto cmds), run
docker-compose run --user $(id -u):$(id -g) app bash
.