docker
docker copied to clipboard
Error: Could not find a production build in the '/app/.next' directory.
When I try to docker-compose up -d --build, the build is completed successfully but the calendso app container keeps restarting. Looking into docker logs, I get these errors:
+ /app/scripts/wait-for-it.sh db:5432 -- echo 'db is up'
db is up
+ npx prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "calendso", schema "public" at "db:5432"
The database is already in sync with the Prisma schema.
✔ Generated Prisma Client (2.30.3) to ./node_modules/@prisma/client in 746ms
+ yarn start
yarn run v1.22.5
$ next start
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /app/.env
Error: Could not find a production build in the '/app/.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
at Server.readBuildId (/app/node_modules/next/dist/server/next-server.js:1573:23)
at new Server (/app/node_modules/next/dist/server/next-server.js:92:29)
at NextServer.createServer (/app/node_modules/next/dist/server/next.js:107:16)
at async /app/node_modules/next/dist/server/next.js:119:31
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
+ /app/scripts/wait-for-it.sh db:5432 -- echo 'db is up'
db is up
+ npx prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "calendso", schema "public" at "db:5432"
The database is already in sync with the Prisma schema.
✔ Generated Prisma Client (2.30.3) to ./node_modules/@prisma/client in 684ms
┌─────────────────────────────────────────────────────────┐
│ Update available 2.30.3 -> 3.2.1 │
│ │
│ This is a major update - please follow the guide at │
│ https://pris.ly/d/major-version-upgrade │
│ │
│ Run the following to update │
│ npm i --save-dev prisma@latest │
│ npm i @prisma/client@latest │
└─────────────────────────────────────────────────────────┘
+ yarn start
yarn run v1.22.5
$ next start
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /app/.env
Error: Could not find a production build in the '/app/.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
at Server.readBuildId (/app/node_modules/next/dist/server/next-server.js:1573:23)
at new Server (/app/node_modules/next/dist/server/next-server.js:92:29)
at NextServer.createServer (/app/node_modules/next/dist/server/next.js:107:16)
at async /app/node_modules/next/dist/server/next.js:119:31
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
+ /app/scripts/wait-for-it.sh db:5432 -- echo 'db is up'
db is up
+ npx prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "calendso", schema "public" at "db:5432"
The database is already in sync with the Prisma schema.
✔ Generated Prisma Client (2.30.3) to ./node_modules/@prisma/client in 459ms
+ yarn start
yarn run v1.22.5
$ next start
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /app/.env
Also addressing this in my WIP dockerfile updates
please re-test with the current build
Closing for inactivity
I am experiencing this issue with the most up to date version of this repo
Are you experiencing the issue with your own built image or the provided image?
with my own built image
Experiencing the same issue with the current version of the repo after trying to build the image with the instructions provided in the README
Using typescript, nothing changed. Unable to find the production build when running DEV
And now this is happening to me too. This takes place after I ran into issues with an outdated yarn lockfile in the latest codebase.
I'm astounded by how frequently I run into new issues every time I update and attempt to redeploy our docker instance. One of the points of containerization is to remove environment-based issues. Why does the docker container rely on build-time variables? Is there a roadmap for converting these variables to runtime-only?