Skip to content

Commit

Permalink
replace mentions of mongo with postgre
Browse files Browse the repository at this point in the history
  • Loading branch information
mariovyord committed Jan 8, 2024
1 parent 25d1b2c commit 58c760e
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 191 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ ALLOW_ORIGIN="*"
ALLOW_METHODS="GET,PUT,POST,PATCH,DELETE,HEAD,OPTIONS"
ALLOW_HEADERS="Content-Type,Cache-Control,Expires"
JWT_SECRET=SUPERSECRET
CONNECTION_STRING="mongodb://express-ts-api-mongo-1:27017/express-template"
18 changes: 10 additions & 8 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
networks:
- backend
depends_on:
- mongo
- postgres_db
env_file:
- .env.local
volumes:
Expand All @@ -23,17 +23,19 @@ services:
mode: replicated
replicas: 1

mongo:
image: mongo:6.0.4
postgres_db:
image: postgres:latest
container_name: postgres_db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=123123
ports:
- "27018:27017"
networks:
- backend
- "6543:5432"
volumes:
- mongodata:/data/db
- postgres_db:/var/lib/postgresql/data

volumes:
mongodata:
postgres_db:
driver: local

networks:
Expand Down
18 changes: 10 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@ services:
networks:
- backend
depends_on:
- mongo
- postgres_db
env_file:
- .env
deploy:
mode: replicated
replicas: 1

mongo:
image: mongo:6.0.4
postgres_db:
image: postgres:latest
container_name: postgres_db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=123123
ports:
- "27018:27017"
networks:
- backend
- "6543:5432"
volumes:
- mongodata:/data/db
- postgres_db:/var/lib/postgresql/data

volumes:
mongodata:
postgres_db:
driver: local

networks:
Expand Down
168 changes: 13 additions & 155 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"helmet": "^7.1.0",
"joi": "^17.11.0",
"jsonwebtoken": "^9.0.2",
"mongoose-beautiful-unique-validation": "^7.1.1",
"morgan": "^1.10.0",
"pg": "^8.11.3",
"reflect-metadata": "^0.2.1",
Expand Down
4 changes: 1 addition & 3 deletions src/features/article/article-types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { ObjectId } from "mongodb";
import { IUser, UserDto } from "../user/user-types";
import { isValidObjectId } from "mongoose";
import { UserDto } from "../user/user-types";
import { Article } from "./article-entity";

export type ICreateArticleData = {
Expand Down
4 changes: 1 addition & 3 deletions src/features/comment/comment-types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { ObjectId, WithId } from "mongodb";
import { isValidObjectId } from "mongoose";
import { IUser, UserDto } from "../user/user-types";
import { UserDto } from "../user/user-types";
import { Comment } from "./comment-entity";

export type ICreateCommentData = { content: string; parent: string; article: string };
Expand Down
Loading

0 comments on commit 58c760e

Please sign in to comment.