shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.7k stars 1.27k forks source link

gitTimestamp missing in docker image with turbo #2943

Open VojtechVidra opened 3 months ago

VojtechVidra commented 3 months ago

I'm not 100% sure where is the issue, but I figured I'll ask here first.

When I'm using development server or run build locally the gitTimestamp works as expected. However when I build the nextra project to docker image the gitTimestamp doesn't show anything.

I think it has something to do with turbo prune and maybe the fact that the .git folder is not present in the image when next build is run. I'm using nextra in monorepo with turbo and deploying with standard Dockerfile suggested in turbo docs: https://turbo.build/repo/docs/guides/tools/docker#example

Do you have an idea what might be the issue?

I'm happy to investigate on my own and update the issue. Since I don't know how nextra works under the hood I've kindof run out of ideas. Thanks!

gautamgambhir97 commented 1 month ago

I'm not 100% sure where is the issue, but I figured I'll ask here first.

When I'm using development server or run build locally the gitTimestamp works as expected. However when I build the nextra project to docker image the gitTimestamp doesn't show anything.

I think it has something to do with turbo prune and maybe the fact that the .git folder is not present in the image when next build is run. I'm using nextra in monorepo with turbo and deploying with standard Dockerfile suggested in turbo docs: https://turbo.build/repo/docs/guides/tools/docker#example

Do you have an idea what might be the issue?

I'm happy to investigate on my own and update the issue. Since I don't know how nextra works under the hood I've kindof run out of ideas. Thanks!

@VojtechVidra I encountered a similar issue when running an app with Docker. To resolve it, you need to install Git in the Docker image and ensure that your .dockerignore file does not exclude the .git directory. This will allow the setup to work correctly with Docker.