Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

DATABASE_URL="postgresql://pguser:pgpassword@localhost:5432"
REDIS_URL="redis://redis:6379"
MONGODB_USERNAME="gigi"
MONGODB_PASSWORD="taichi"
MONGODB_HOST="mongodb"
19 changes: 15 additions & 4 deletions deploy/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,24 @@ services:
# Build image nodeserver from Dockerfile in GitHub repo
image: nodejs-cicd
build:
context: https://github.com/CleverseAcademy/nodejs-cicd.git#develop
args:
FROM_REPO: https://github.com/CleverseAcademy/nodejs-cicd
APP_VERSION: compose-develop
# context: https://github.com/CleverseAcademy/nodejs-cicd.git#develop
context: ..
environment:
MONGODB_USERNAME: gigi
MONGODB_PASSWORD: taichi
MONGODB_HOST: mongodb
REDIS_URL: redis://redis:6379
DATABASE_URL: postgresql://pguser:pgpassword@postgresql:5432
ports:
- "8000:8000"

redis:
image: redis:7.0

postgres:
image: postgres:15
ports:
- 5432:5432
environment:
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=pgpassword
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
"@types/jest": "^29.5.3",
"@types/node": "^20.4.2",
"jest": "^29.6.1",
"prisma": "^5.0.0",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
},
"dependencies": {
"@prisma/client": "5.0.0",
"@types/redis": "^4.0.11",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"mongodb": "^5.7.0"
"mongodb": "^5.7.0",
"redis": "^4.6.7"
}
}
120 changes: 119 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions prisma/migrations/20230728022159_init/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"email" TEXT NOT NULL,
"name" TEXT,

CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
3 changes: 3 additions & 0 deletions prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"
17 changes: 17 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

model User {
id Int @id @default(autoincrement())
email String @unique
name String?
}
Loading