chore: create Dockerfile

This commit is contained in:
Moritz Böhme 2025-05-15 08:48:39 +02:00
parent 3b196006c0
commit 44996e7714
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
7 changed files with 187 additions and 0 deletions

28
lib/putzplan/release.ex Normal file
View file

@ -0,0 +1,28 @@
defmodule Putzplan.Release do
@moduledoc """
Used for executing DB release tasks when run in production without Mix
installed.
"""
@app :putzplan
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