diff --git a/docker-compose.yml b/docker-compose.yml index f77f19b..d599921 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,10 +22,18 @@ services: SERVER_FORWARD_HEADERS_STRATEGY: native volumes: - # Persist uploaded images and files - # NOTE: production profile (application.yml) sets file.upload.directory to - # /var/uploads/blog-images — this mount MUST match that path or uploads - # silently write to the container's ephemeral layer and vanish on redeploy. + # Persist uploaded images and files. + # This same named volume is mounted at TWO paths on purpose: + # - /app/uploads: hardcoded in FileConstant.java for hero/professor/ + # user avatar images (does NOT read file.upload.directory). + # - /var/uploads/blog-images: read from file.upload.directory + # (application.yml production profile) for blog post images. + # The volume already contains hero/ and user/ subfolders plus the + # blog post images at its root from before this was mounted twice — + # mounting both paths makes all of it visible again with no data + # migration needed. Do not change either path without updating the + # other or the corresponding app config. + - blog-uploads:/app/uploads - blog-uploads:/var/uploads/blog-images networks: - angular-spring