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 | bash
This will:
- Clone the repository into
~/.config/phx-dock
. - Create a symlink
~/.local/bin/phxd-new
for easy access.
After installation, you can run phxd-new
from anywhere.
Use phxd-new
to create a new Phoenix project:
phxd-new my_app
This 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_app
Then, start the application:
docker compose up
Your 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.