A Github Codespace template for setting up an Elixir & Phoenix Framework project.
Click the green Use this template
button to create a repository for your project with the .devcontainer
folder included. Next, clone it locally to work from your machine or click the green Code
button to create a new codespace to do cloud editing.
Codespaces have terminal access allowing you to run commands such as iex
, mix
, node
, and npm
.
Run the following command from the terminal:
mix phx.new . --app your_app_name
Important notes:
- The
.
in the command instructsphx.new
to generate the project in the current working directory which will be the root of the repository. - As of Phoenix 1.6, LiveView is enabled by default therefore you no longer need to pass in the
--live
flag. See mix phx.new options for additional flags to customize your project creation.
There are 3 files within the .devcontainer
folder:
docker-compose.yml
describes the projects services and dictatest the Elixir, Phoenix & Postgres versions:
EX_VERSION
- Elixir Version. Default is latestPHX_VERSION
- Phoenix Version. Default is 1.6.2db
service - Postgres Version. Default is latest viapostgres:latest