Add Dockerfile-based Dokku deployment for monorepo layout

Uses a multi-stage Docker build that copies both app/ and blogex/,
preserving the path dependency. Includes release scripts, migration
module, and a sample Dokku setup script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Willem van den Ende
2026-03-18 10:55:44 +00:00
co-authored by Claude Opus 4.6
parent e56ea0400f
commit 2d97353649
8 changed files with 219 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
defmodule Firehose.Release do
@moduledoc """
Tasks for production releases (e.g., database migrations).
Usage from Dokku:
dokku run APP_NAME /app/bin/migrate
"""
@app :firehose
def migrate do
load_app()
for repo <- repos() do
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true))
end
end
def rollback(repo, version) do
load_app()
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
end
defp repos do
Application.fetch_env!(@app, :ecto_repos)
end
defp load_app do
Application.load(@app)
end
end
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -eu
cd -P -- "$(dirname -- "$0")"/..
exec ./bin/firehose eval Firehose.Release.migrate
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -eu
cd -P -- "$(dirname -- "$0")"/..
PHX_SERVER=true exec ./bin/firehose start