add npm run mongo:start to quickly spin up fake replicated mongodb server for prisma
This commit is contained in:
parent
ad75aea294
commit
ffab3010b3
@ -6,13 +6,6 @@
|
|||||||
# secrets in it. If you are cloning this repo, create a copy of this file named
|
# secrets in it. If you are cloning this repo, create a copy of this file named
|
||||||
# ".env" and populate it with your secrets.
|
# ".env" and populate it with your secrets.
|
||||||
|
|
||||||
# When adding additional environment variables, the schema in "/src/env.mjs"
|
|
||||||
# should be updated accordingly.
|
|
||||||
|
|
||||||
# Prisma
|
|
||||||
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
|
|
||||||
DATABASE_URL="file:./db.sqlite"
|
|
||||||
|
|
||||||
# Next Auth
|
# Next Auth
|
||||||
# You can generate a new secret on the command line with:
|
# You can generate a new secret on the command line with:
|
||||||
# openssl rand -base64 32
|
# openssl rand -base64 32
|
||||||
@ -22,7 +15,7 @@ NEXTAUTH_URL="http://localhost:3000"
|
|||||||
|
|
||||||
# MongoDB
|
# MongoDB
|
||||||
# mongo DB details
|
# mongo DB details
|
||||||
MONGO_DATABASE=
|
MONGO_DATABASE=atr_db
|
||||||
DATABASE_URL=
|
DATABASE_URL=
|
||||||
MONGO_ROOT_USERNAME=
|
MONGO_ROOT_USERNAME=
|
||||||
MONGO_ROOT_PASSWORD=
|
MONGO_ROOT_PASSWORD=
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
version: '3.7'
|
|
||||||
|
|
||||||
services:
|
|
||||||
atr_mongodb:
|
|
||||||
image: mongo:latest
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
- MONGO_ROOT_USERNAME
|
|
||||||
- MONGO_ROOT_PASSWORD
|
|
||||||
ports:
|
|
||||||
- 27017:27017
|
|
||||||
volumes:
|
|
||||||
- mongodb_container:/data/db
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mongodb_container:
|
|
@ -8,7 +8,7 @@
|
|||||||
"postinstall": "prisma generate",
|
"postinstall": "prisma generate",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"mongodb:up": "docker compose up"
|
"mongo:start": "docker run --rm -d -p 27017:27017 -h $(hostname) --name uiowa_atr_mongo mongo:4.4.3 --replSet=test && sleep 4 && docker exec mongo mongo --eval \"rs.initiate();\""
|
||||||
},
|
},
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
|
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user