add Docker deployment with Alpine image, release config and health check
- Alpine multi-stage Dockerfile (131 MB image) - Release overlays (bin/server, bin/migrate), env.sh, Release module - Health check endpoint at GET /health - Fly.io config with SQLite volume mount - Fix hardcoded paths in optimizer.ex and variant_cache.ex to use Application.app_dir/2 (breaks in releases where Plug.Static serves from a different directory than CWD) - strip_beams: true in release config - Optimised .dockerignore and .gitignore for mockup variants Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
defmodule SimpleshopThemeWeb.HealthController do
|
||||
use SimpleshopThemeWeb, :controller
|
||||
|
||||
def show(conn, _params) do
|
||||
json(conn, %{status: "ok"})
|
||||
end
|
||||
end
|
||||
@@ -52,6 +52,13 @@ defmodule SimpleshopThemeWeb.Router do
|
||||
post "/checkout", CheckoutController, :create
|
||||
end
|
||||
|
||||
# Health check (no auth, no theme loading — for load balancers and uptime monitors)
|
||||
scope "/", SimpleshopThemeWeb do
|
||||
pipe_through [:api]
|
||||
|
||||
get "/health", HealthController, :show
|
||||
end
|
||||
|
||||
# Cart API (session persistence for LiveView)
|
||||
scope "/api", SimpleshopThemeWeb do
|
||||
pipe_through [:browser]
|
||||
|
||||
Reference in New Issue
Block a user