Skip to content

Commit 65281fd

Browse files
committed
Docker Compose enabled switched to Node Image
1 parent 107cd3a commit 65281fd

File tree

5 files changed

+18
-26
lines changed

5 files changed

+18
-26
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
FROM node:20-alpine
1+
FROM node:22
22

33
WORKDIR /usr/src/app
44

55
# Copy package files and install dependencies
66
COPY package*.json ./
7+
RUN rm -rf node_modules
78
RUN npm install
89

910
# Create the logs directory and set permissions

Readme.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
1-
## Install dependancies
1+
### Install dependancies
22

33
`npm install`
44

5-
## ENV setup
5+
### ENV setup
66

77
`cp .env.sample .env`
88

9-
## Run the app
9+
### Run the app
1010

1111
`npm run dev`
1212

13-
## Take the Build
13+
### Take the Build
1414

1515
`npm run build`
1616

17-
## Unit Tesing
17+
### Unit Tesing
1818

1919
`npm run test`
2020

2121

22-
## Prisma ORM
22+
### Docker Setup
23+
24+
`docker compose up -d --build`
25+
26+
make sure your DB connections allowed from container, The localhost in the ENV won't work if you trying from docker without allowing mysql configuration to access your DB remotely
27+
28+
### Prisma ORM
2329

2430
`npm run prisma:generate`
2531

2632
`npm run prisma:migrate`
2733

28-
## Swagger URL
34+
### Swagger URL
2935

3036
`http://localhost:PORT/api-docs`
3137

package-lock.json

Lines changed: 1 addition & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@types/express": "^4.17.13",
3838
"@types/jest": "^27.5.2",
3939
"@types/node": "^16.11.10",
40+
"@types/supertest": "^6.0.2",
4041
"@types/swagger-jsdoc": "^6.0.4",
4142
"@types/swagger-ui-express": "^4.1.6",
4243
"@typescript-eslint/eslint-plugin": "^5.2.0",
@@ -45,6 +46,7 @@
4546
"eslint": "^8.2.0",
4647
"jest": "^29.7.0",
4748
"prisma": "^5.16.2",
49+
"supertest": "^7.0.0",
4850
"ts-jest": "^29.2.2",
4951
"ts-node": "^10.9.2",
5052
"ts-node-dev": "^1.1.8",

src/services/userService.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,14 @@ export class UserService {
2828
}
2929

3030
async updateUser(userId: number, data: Partial<User>): Promise<User | null> {
31-
try{
3231
const updatedUser = await prisma.user.update({
3332
where: { id: userId },
3433
data: data,
3534
});
3635
return updatedUser;
37-
}catch(error){
38-
throw(error);
39-
}
4036
}
4137

4238
async deleteUser(userId: number): Promise<void> {
43-
4439
await prisma.user.delete({
4540
where: {
4641
id: userId,

0 commit comments

Comments
 (0)