persist mockup variants on fly volume across deploys
All checks were successful
deploy / deploy (push) Successful in 3m46s
All checks were successful
deploy / deploy (push) Successful in 3m46s
Source mockup WebPs are copied from the release to /data/mockups/ on startup, and variants are generated there. This eliminates the 182-job storm on every deploy that was saturating the CPU and causing SQLite locking. After the first successful run, subsequent deploys find all variants intact. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ defmodule BerrypodWeb.Endpoint do
|
||||
websocket: [connect_info: [session: @session_options]],
|
||||
longpoll: [connect_info: [session: @session_options]]
|
||||
|
||||
# In prod, image variants live on the persistent volume (/data/image_cache)
|
||||
# In prod, image variants and mockups live on the persistent volume
|
||||
# rather than inside the ephemeral release directory.
|
||||
if image_cache_dir = Application.compile_env(:berrypod, :image_cache_dir) do
|
||||
plug Plug.Static,
|
||||
@@ -25,6 +25,13 @@ defmodule BerrypodWeb.Endpoint do
|
||||
cache_control_for_etags: "public, max-age=31536000, immutable"
|
||||
end
|
||||
|
||||
if mockup_dir = Application.compile_env(:berrypod, :mockup_dir) do
|
||||
plug Plug.Static,
|
||||
at: "/mockups",
|
||||
from: mockup_dir,
|
||||
cache_control_for_etags: "public, max-age=31536000, immutable"
|
||||
end
|
||||
|
||||
# Serve at "/" the static files from "priv/static" directory.
|
||||
# gzip only in prod — avoids stale .gz files from mix assets.deploy
|
||||
# shadowing freshly-built dev assets.
|
||||
|
||||
Reference in New Issue
Block a user