nestjs-docker-prisma-mysql
Application template for NestJS + Docker + Prisma + MySQL
Setup
# install
$ yarn
# Setup env file for database
$ cp .env.example .env
# run containers
$ yarn dev
# setup database ( sync database schema )
$ docker exec -it app yarn db:apply
# insert seed data
$ docker exec -it app yarn db:seed
Currently HMR is not enabled, so the server will reload on every file change.
Use Prisma Studio
You can view / edit DB tables using Prisma Studio.
Once you run yarn dev
, you can open it in http://localhost:5555
.
Migration (Development)
Log in to the app
container and run
$ docker exec -it app yarn db:migrate:dev
Swagger
Swagger UI is available on http://localhost:3000/api
Minio Console
Minio Console is an admin console for uploaded file storage, available on http://localhost:33023
Test
# unit tests
$ docker exec -it app yarn test
# e2e tests
$ docker exec -it app yarn test:e2e
# test coverage
$ docker exec -it app yarn test:cov