'Running website via Docker on macOS loading images but not on server
I run a website via Docker as I develop on macOS and macOS is set up with a case-insensitive filesystem by default.
When I run the site, I was rendering an image with no issues locally via Docker. When I deployed, it didn't work. Upon inspection I found that the image was This_Is_My_Image.jpg, yet I was requesting this_is_my_image.jpg.
My [incorrect] assumption was that using Docker I would gain the advantage of Linux with it being case-sensitive as default but it seems that the file system is inherited into Docker - meaning that my Docker image (node:fermium-buster-slim) is running a file system which is case-insensitive?
My Dockerfile.dev is:
FROM node:fermium-buster-slim
ARG GID=1000
ARG UID=1000
USER ${UID}:${GID}
WORKDIR /usr/app
COPY . .
EXPOSE 3000
ENTRYPOINT [ "npm", "run", "dev" ]
The production image runs on a Linux system which makes me think that this is the case?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
