Skip to content
Snippets Groups Projects
Commit 6a47d719 authored by Fionn's avatar Fionn
Browse files

Docker file added.server.js file added and can be called with node server.js.

parent a70ed8f1
No related branches found
No related tags found
No related merge requests found
# Start from the official Node.js image
FROM node:18
# Set the working directory in the container
WORKDIR /app
# Copy package.json and install dependencies
COPY package*.json ./
RUN npm install
# Copy the rest of your app (code + frontend files)
COPY . .
# Expose the port your app runs on
EXPOSE 3000
# Start the server
CMD ["npm", "start"]
......@@ -4,7 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"keywords": [],
"author": "",
......
console.log("Hello from server.js");
\ No newline at end of file
......@@ -6,6 +6,6 @@
<title>BookRate</title>
</head>
<body>
<h1> Book Rating Application</h1>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment