- Create the network
docker network create caddie_network
- Pull docker dependencies
docker compose pull
- Build the Nest image
docker compose build
- Install the dependencies and generate the prisma schemes
docker compose run --rm backend npm ci \
&& docker compose run --rm backend npx prisma generate
- Run the migrations
docker compose run --rm backend npx prisma migrate dev --name init
- Seed the database
docker compose run --rm backend npx prisma db seed
- Start the app
docker compose up
- Check the node version
docker compose exec backend node -v
docker compose stop \
&& docker compose down -v \
&& docker compose down --rmi all \
&& docker compose rm --volumes \
&& docker builder prune -a \
&& docker image prune -a \
&& docker container prune \
&& docker system prune -a --volumes
docker compose build --pull --no-cache
nvm install && nvm use
sudo rm -rf ./node_modules && sudo rm -rf ./dist
fastify
's installed version must match the one installed in @nestjs/platform-fastify
> npm ls fastify
[email protected] /path/to/project/caddie-backend-nest
├─┬ @nestjs/[email protected]
│ └── [email protected] deduped
└── [email protected]
Install one that's matching
Check in the package-lock.json
the version of fastify-plugin
in the dependencies of @fastify/cookie
.
For example here it means it's compatible with fastify v4.
"node_modules/@fastify/cookie": {
"version": "9.4.0",
"resolved": "https://registry.npmjs.org/@fastify/cookie/-/cookie-9.4.0.tgz",
"integrity": "sha512-Th+pt3kEkh4MQD/Q2q1bMuJIB5NX/D5SwSpOKu3G/tjoGbwfpurIMJsWSPS0SJJ4eyjtmQ8OipDQspf8RbUOlg==",
"dependencies": {
"cookie-signature": "^1.1.0",
"fastify-plugin": "^4.0.0" <------------
}
},