View rel-config.exs
# ...
release :my_app do
# ...
set(
applications: [
:runtime_tools,
my_app: :permanent
]
View Flexible Dockerized Phoenix Deployments.md

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

View form.html.eex
<tags-input>
<%= hidden_input form, :tags, value: [] , class: "input" %>
</tags-input>
View elixir_run_for_envs.md

Ever found yourself writing code like this?

case Mix.env() do
  :prod -> do_something1()
  :dev  -> do_something2()
  :test -> do_something3()
end
View .deliver_config
# MYAPP/.deliver/config
APP="<APP NAME>"
MAIN_HOST="<BUILD & PRODUCTION HOST>"
MAIN_USER="<MAIN USER FOR BUILD AND DEPLOY>"
BUILD_HOST="${MAIN_HOST}"
BUILD_USER="${MAIN_USER}"
BUILD_AT="/tmp/edeliver/${APP}/builds"
View geometry.ex
module Geometry do
@moduledoc """
Calculates area of different shapes
"""
@doc """
Some other comment
"""
def area({:rectangle, width, height}) do: width * height
def area({:square, side}) do: side * side
View brunch-config.js
exports.config = {
optimize: false,
sourceMaps: true,
files: {
javascripts: {
joinTo: "js/app.dev.js"
},
stylesheets: {
joinTo: "css/app.dev.css",
View config_application_generators.rb
config.generators do |generate|
generate.helper false
generate.javascript_engine false
generate.request_specs false
generate.routing_specs false
generate.stylesheets false
generate.test_framework :rspec
generate.view_specs false
end
View gist:c2498cea768bcfac8291
RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
end