diff --git a/backend/Dockerfile b/backend/Dockerfile index 6b3be7d..51eacc3 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -9,7 +9,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ WORKDIR /app RUN apt-get update \ - && apt-get install -y --no-install-recommends curl ca-certificates \ + && apt-get install -y --no-install-recommends curl ca-certificates libmagic1 \ && rm -rf /var/lib/apt/lists/* \ && pip install --no-cache-dir uv diff --git a/backend/apps/common/tests.py b/backend/apps/common/tests.py index 3e248ec..480bc48 100644 --- a/backend/apps/common/tests.py +++ b/backend/apps/common/tests.py @@ -2,6 +2,7 @@ from unittest.mock import patch from types import SimpleNamespace from uuid import uuid4 +from django.conf import settings from django.test import SimpleTestCase from django.utils import timezone @@ -35,3 +36,10 @@ class CursorPaginationTests(SimpleTestCase): self.assertEqual(decoded_created_at, created_at) self.assertEqual(decoded_id, str(record_id)) + + +class BackendImageDependencyTests(SimpleTestCase): + def test_backend_image_installs_libmagic_for_python_magic(self): + dockerfile = settings.BASE_DIR / "Dockerfile" + + self.assertIn("libmagic1", dockerfile.read_text(encoding="utf-8"))