Special thanks to 99lalo Github profile for give me the first boilerplate and the dockers file to make it possible
If you want to run the app in development mode, you can run npm run docker:compose:dev.
For running on production mode you can run npm run docker:compose:prod, but know that you won't have hot reloading.
You also need to create your .env and .dockerignore files.
This is a Next.js project bootstrapped with create-next-app.
Git clone:
git clone https://github.com/DaliGabriel/NextjsPostgresqlDockerCompose.gitAccess the folder:
cd NextjsPostgresqlDockerCompose/Install node packages:
npm iInstall node packages:
npm run docker:compose:devInit the migrations previously defined on Prisma/schema.prisma:
docker exec -it <ContainesId> npx prisma migrate dev --name initRun the seeders(optional):
docker exec -it <ContainesId> npx prisma db seedRun prisma studio(optional):
docker exec -it <ContainesId> npx prisma studioOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.