Skip to content

Instantly share code, notes, and snippets.

@beeman
Last active September 2, 2020 11:17
Show Gist options
  • Save beeman/5832d625122048af78dbd475110c7c4d to your computer and use it in GitHub Desktop.
Save beeman/5832d625122048af78dbd475110c7c4d to your computer and use it in GitHub Desktop.
@Injectable()
export class DataService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
constructor() {
super()
}
async onModuleInit() {
await this.$connect()
}
async onModuleDestroy() {
await this.$disconnect()
}
}
version: '3'
services:
postgres:
image: postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: prisma
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
volumes:
- ./tmp/postgres:/var/lib/postgresql/data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment