Details
I'm trying to deploy a React.js project to docker, but the App.css styles aren't being applied to the HTML elements. The App.css file is being properly imported and can be found in the page sources, but the elements aren't applying their classes.
Configuration
Dockerfile
FROM node:20.10.0 AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:latest
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
sendfile on;
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}
}
Client pictures
Conclusion
It's possible that I might have misconfigured like package.json or some other React.js component that has an impact on this. I'm still very new to react and might have deleted some important setting or something.
Any help or suggestions would be greatly appreciated


