This project is a Node.js web application containerized using Docker. It provides a basic web server that serves dynamic content using the EJS templating engine. The application includes logging capabilities and handles routes for rendering webpages in multiple languages.
The Dockerfile (Dockerfile
) contains instructions for building the Docker image for this Node.js application. It defines the following steps:
-
Base Image: It starts with the latest Node.js image as the base image.
-
Working Directory: It sets up a working directory within the container at
/app
. -
Application Files: It copies the contents of the
/bin/app
directory into the container's working directory. This includes your Node.js application code. -
Dependency Installation: It runs
yarn install
to install the project's dependencies. -
Default Command: It specifies the default command to start the Node.js application, which is
yarn main
. -
Port Exposure: It exposes port 8887 for external access.
Comming soon.
-
main.js
: This is the main server script (main.js
) responsible for handling HTTP requests and defining route handlers. It uses the Express.js framework to set up the server, handle routing, and serve dynamic content using EJS templates. Key features include:-
Middleware: It sets up middleware for logging requests using the Winston library.
-
Error Handling: It includes error handling middleware to log and handle errors gracefully.
-
Routing: It defines various routes for rendering webpages in different languages and redirects for specific URLs.
-
Logging: It configures the Winston logger to log request information.
-
The /bin/app/views/
directory contains EJS templates for rendering webpages. These templates are used to generate dynamic HTML content based on the requested URL.
The /bin/app/public/static/
directory contains static assets such as CSS and JavaScriptfiles that are used to style and enhance the webpages.
This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.