Use with next js and docker compose

Why is the process.env.NEXT_PUBLIC_API_URL variable available only in getServerSideProps when deploying next js application from doppler to docker compose?

Source - GitHub - dapzer/movie-tracker at feat-deploy-add_docker