No description
- Dockerfile 100%
| .dockerignore | ||
| .gitignore | ||
| compose.yml | ||
| Dockerfile | ||
| README.de.md | ||
| README.md | ||
Elixir Phoenix Dev Container
A Docker-based development environment for Elixir and Phoenix projects.
Overview
This repository provides a ready-to-use development container with:
- Elixir 1.19.4 / Erlang/OTP 28.3 on Debian Trixie
- PostgreSQL 18 as database
- Phoenix and Igniter archives pre-installed
- Multi-stage Dockerfile with
developmentand productionbuilder/finalstages - Persistent bash history across container restarts
Quick Start
- Clone this repository
- Start the development environment:
docker compose up -d
docker compose exec app bash
- Inside the container, create a new Phoenix project:
mix phx.new my_app --database postgres
cd my_app
mix ecto.create
mix phx.server
The application will be available at http://localhost:4000.
Structure
├── Dockerfile # Multi-stage build (development + production)
└── compose.yml # Development services (app + PostgreSQL)
Dockerfile Stages
| Stage | Purpose |
|---|---|
package_installer |
Base image with build dependencies |
development |
Interactive development with Hex, Rebar, Phoenix archives |
builder |
Compiles assets and creates a release |
final |
Minimal runtime image for production |
Development
The compose.yml starts the app container in interactive mode (bash). This allows you to create or work on Phoenix projects inside the container while your project directory is mounted as a volume.
Database
PostgreSQL is available at localhost:5432 from the host or db:5432 from within the container network.
Production Build
To build a production release:
docker build --target final -t my-app .