https://github.com/mnishiguchi/phx-dock
Set up a Phoenix development environment inside a Docker container
https://github.com/mnishiguchi/phx-dock
docker-compose elixir phoenix-framework
Last synced: about 1 year ago
JSON representation
Set up a Phoenix development environment inside a Docker container
- Host: GitHub
- URL: https://github.com/mnishiguchi/phx-dock
- Owner: mnishiguchi
- License: apache-2.0
- Created: 2023-11-24T17:50:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-05T00:01:58.000Z (over 1 year ago)
- Last Synced: 2025-04-23T03:37:50.944Z (about 1 year ago)
- Topics: docker-compose, elixir, phoenix-framework
- Language: Shell
- Homepage: https://dev.to/mnishiguchi/build-phoenix-docker-compose-development-environment-using-phx-docker-compose-new-instead-of-mix-phxnew-20n2
- Size: 23.4 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phx-dock: Run Phoenix in Docker
## Introduction
`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.
## Installation
To install `phxd-new`, run:
```sh
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.
## Creating a Phoenix App Using `phxd-new`
Use `phxd-new` to create a new Phoenix project:
```sh
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.
## Running your Phoenix App in Docker
After generating your Phoenix project with `phxd-new`, you can start your
development environment using Docker.
Navigate into your project directory:
```sh
cd my_app
```
Then, start the application:
```sh
docker compose up
```
Your Phoenix app will be available at: http://localhost:4000
## Using Livebook
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.