-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add docker & api route #124
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM node:19-alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup | ||
USER appuser | ||
|
||
RUN apk add --no-cache git | ||
COPY . . | ||
CMD ["npm", "start", "--no-update-notifier"] | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
class Configuration { | ||
|
||
serverPort() { | ||
return process.env.PORT || 8080; | ||
return process.env.PORT || 80; | ||
} | ||
Comment on lines
+4
to
5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You changed the default server port from 8080 to 80. This change seems important, so it might be smart to change the documentation accordingly. Update the documentation to reflect the new default port. For example: ## Running the Application
To start the application, use:
```bash
npm start The application will now run on port 80 by default.
|
||
logLevel(){ | ||
return process.env.LOG_LEVEL || "info"; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,7 @@ const router = express.Router(); | |
router.route("/:id") | ||
.get(grantAccessByPermissionMiddleware([API_PERMISSIONS.PUBLIC_ENDPOINT]), exampleController.getById) | ||
|
||
router.route("/get/:id").get(exampleController.getById) | ||
|
||
Comment on lines
+12
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The route '/get/:id' is missing the
(Based on guideline 'Routes should check permissions') |
||
|
||
export default router; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your Dockerfile should implement multi-stage builds to optimize image size and improve build performance. Consider using a builder stage to install dependencies and build the application, then copy the necessary files to a smaller runtime image. Here's an example:
(Based on guideline 'Dockerfiles should use multi-stage builds')