Docker Definition Error for Not Running Command onto the MVC

Dear Docker Community:

In a Docker definition (Dockerfile), I have generally focus on containerizing my application, which includes specifying how the application environment should be set up and what should be included in the container. The MVC (Model-View-Controller) structure is a design pattern for organizing the code within your Node.js application, and it primarily relates to the code and application structure inside the container, not the Dockerfile itself. However, each time I have run the Docker command then I have typed in the localhost:8080 then I will receive an error message that stated “CANNOT GET”.

Here is an example of my Dockerfile Definition:

Use an appropriate Node.js base image

FROM node:18-alpine

Set the working directory in the container

WORKDIR /ivoteballot

COPY controllers /ivoteballot/

COPY models /ivoteballot/

Copy the rest of your application files to the container

COPY . .

Copy package.json and package-lock.json to the container

COPY package.json /ivoteballot/

COPY package-lock.json /ivoteballot/

Install dependencies

RUN npm install

EXPOSE 8080

Define the command to start your Node.js application

CMD [“node”, “index.js”]

Here is my docker command lines:
2023-10-05 18:42:31 The contactUs_01_Session have been successfully created
2023-10-05 18:42:31 Thu, 05 Oct 2023 23:42:31 GMT express-session deprecated undefined resave option; provide resave option at models/contactUs_01_Router.js:99:2
2023-10-05 18:42:31 Thu, 05 Oct 2023 23:42:31 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at models/contactUs_01_Router.js:99:2
2023-10-05 18:42:31 The user’s have successfully created an Alabama PDF candidates file final results
2023-10-05 18:42:31 The user had successfully download the Alabama PDF candidates file have been successfully created.
2023-10-05 18:42:31 The Nodejs in conjunction with Express framework is listening onto port 8080 from express’ iVoteBallotApp prototype 2.
2023-10-05 18:42:31 Developer has created the SQLite3 database connection from her JavaScript codes language which has a generated successfully connection.
2023-10-05 18:42:31 Developer has created a Sqlite3 database table which was programmatically coded successfully!
And, her is my error message:

“Can not GET” is usually an error returned from the application, when you try a path that should be accessed with a different http method like POST.

Hi Bluepuma77:

You are correct. I am new to the Docker environment, and I had forgot to add the webpage path to the localhost:8080/ivoteballot, and now it works.

Thanks for reaching out to me, BluePuma77.