This repo contains the files and templates necessary to bootstrap a brand new Phoenix project using Nanobox.
If you haven't already, create a free Nanobox account and download and install Nanobox.
# create a new project directory and cd in
mkdir phoenix-app && cd phoenix-app
# run the bootstrap
bash <(curl -sL https://git.io/vQhEX)
The bootstrap will provision a dev environment, install Phoenix, and start the Phoenix server. You'll find the IP and port where you can see the running up just before the Phoenix compilation output.
Once the project is bootstrapped, building it out is really simple.
To fire up the app's dev environment and drop into a console in the environment, just run:
nanobox run
Your local codebase is mounted into the dev container. Any changes to the code are reflected in your dev app. You can add and load dependencies or any other dev tasks. Or you can simply start Phoenix.
mix phoenix.server
Nanobox also lets you easily add a convenient way to access your Phoenix app from the browser. To add a DNS alias, run the following from the root of your project (outside the Nanobox console).
nanobox dns add local phoenix.dev
After you nanobox run mix phoenix.server
, you'd be able to access the running app at http://phoenix.dev:4000
.
- Create a new app in your Nanobox dashboard
- Add your new app as a remote on your project:
nanobox remote add app-name
- Deploy to your live app:
nanobox deploy