phx-dock provides a simple way to set up a Phoenix development environment
inside a Docker container without installing Elixir or Phoenix on your local
machine.
To install phxd-new, run:
curl -fsSL https://raw.githubusercontent.com/mnishiguchi/phx-dock/main/install.sh | bashThis will:
- Clone the repository into
~/.config/phx-dock. - Create a symlink
~/.local/bin/phxd-newfor easy access.
After installation, you can run phxd-new from anywhere.
Use phxd-new to create a new Phoenix project:
phxd-new my_appThis command:
- Generates a Phoenix application in
my_app/. - Sets up a Docker-based development environment.
- Copies useful
bin/scripts for common tasks.
After generating your Phoenix project with phxd-new, you can start your
development environment using Docker.
Navigate into your project directory:
cd my_appThen, start the application:
docker compose upYour Phoenix app will be available at: http://localhost:4000
If you want to use Livebook, it's already included in the setup. You can access it at: http://localhost:8080
This allows you to run interactive notebooks connected to your Phoenix app.