Next.js Discord

Discord Forum

Running Next.js app inside Docker container doesn't link any CSS files

Answered
seamus4ever posted this in #help-forum
Open in Discord
Avatar
Hello! I'm doing a beginners course on Next.js and one of the topics is teaching how to run the app inside a docker container. I managed to set up the image and run the container and everything works fine except that there are no CSS styles in my app. I inspected the document and noticed there aren't any stylesheet links in it. I'm not exactly sure how to debug this.
Here's a screenshot of the contents of my Dockerfile, and here's the link of the project's repository if anyone wants to check it out.
https://github.com/j-millan/nextjs-first-steps
Image
Image
Answered by gin
COPY . .
View full answer

7 Replies

Avatar
hey i think its because u didnt copy the nest folders aswell
Avatar
COPY . .
Answer
Avatar
Hey, thanks! That actually worked. The guy in the course used / instead of . for the target directory. What's the difference between using the two?
Avatar
if u use / u need to specify the absolute path
but that doesnt matter
in your case u set the workdir in /app but copied the files into /
if u use . . it will choose the relative path based on your workdir