Corregge persistenza loghi Active Storage in produzione.

Monta /app/storage sul disco video dedicato invece che su un volume Docker al path sbagliato, così i logo società/squadra sopravvivono ai rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-13 09:16:35 +02:00
parent dc309fbeb0
commit b802cf3309
2 changed files with 5 additions and 5 deletions

View File

@@ -130,7 +130,7 @@ services:
condition: service_started
volumes:
- ${MATCHLIVETV_VIDEOS_ROOT:-/media/videos/matchlivetv}/recordings:/recordings
- rails_storage:/rails/storage
- ${MATCHLIVETV_VIDEOS_ROOT:-/media/videos/matchlivetv}/active_storage:/app/storage
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:3000/up"]
interval: 15s
@@ -202,7 +202,7 @@ services:
condition: service_started
volumes:
- ${MATCHLIVETV_VIDEOS_ROOT:-/media/videos/matchlivetv}/recordings:/recordings
- rails_storage:/rails/storage
- ${MATCHLIVETV_VIDEOS_ROOT:-/media/videos/matchlivetv}/active_storage:/app/storage
garage:
image: dxflrs/garage:v1.0.1
@@ -235,5 +235,4 @@ services:
volumes:
postgres_data:
redis_data:
rails_storage:
ntfy_data:

View File

@@ -35,7 +35,7 @@ fs_rsync() {
sudo rsync -aH "$@"
}
fs_mkdir "${VIDEOS_ROOT}/recordings" "${VIDEOS_ROOT}/garage/meta" "${VIDEOS_ROOT}/garage/data"
fs_mkdir "${VIDEOS_ROOT}/recordings" "${VIDEOS_ROOT}/garage/meta" "${VIDEOS_ROOT}/garage/data" "${VIDEOS_ROOT}/active_storage"
if [ ! -w "$VIDEOS_ROOT" ]; then
sudo chown -R "$(id -un)":"$(id -gn)" "$VIDEOS_ROOT"
fi
@@ -70,6 +70,7 @@ docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" stop mediamtx sidekiq r
copy_volume recordings "${VIDEOS_ROOT}/recordings"
copy_volume garage_meta "${VIDEOS_ROOT}/garage/meta"
copy_volume garage_data "${VIDEOS_ROOT}/garage/data"
copy_volume rails_storage "${VIDEOS_ROOT}/active_storage"
if ! grep -q '^MATCHLIVETV_VIDEOS_ROOT=' "$ENV_FILE" 2>/dev/null; then
echo "MATCHLIVETV_VIDEOS_ROOT=${VIDEOS_ROOT}" >> "$ENV_FILE"
@@ -95,7 +96,7 @@ docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T rails \
'puts({recordings: `du -sh /recordings 2>/dev/null`.strip, storage: Recordings::Storage.new.backend_name}.inspect)'
echo "Fatto. Volumi Docker obsoleti (rimuovi dopo verifica):"
for v in recordings garage_data garage_meta; do
for v in recordings garage_data garage_meta rails_storage; do
docker volume inspect "${PROJECT}_${v}" --format '{{ .Name }} ({{ .Mountpoint }})' 2>/dev/null || true
done
echo " docker volume rm ${PROJECT}_recordings ${PROJECT}_garage_data ${PROJECT}_garage_meta"