This commit is contained in:
Kajal Thakur 2024-12-26 21:58:41 +05:30
commit 009b206769
4 changed files with 51 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/node_modules
package.json
package-lock.json

10
boltic.yaml Normal file
View File

@ -0,0 +1,10 @@
app: "dec26"
region: "asia-south1"
entrypoint: "index.js"
build:
builtin: dockerfile
ignorefile: .gitignore
env:
PORT: '8080'

24
dockerfile Normal file
View File

@ -0,0 +1,24 @@
# Use an official Node.js image from the Docker Hub
FROM node:18
# Set the working directory inside the container
WORKDIR /
RUN npm config set registry https://registry.npmmirror.com
RUN npm install -g npm@10.8.2
# Copy package.json and package-lock.json (if available)
COPY package*.json ./
# Install dependencies
RUN rm -rf node_modules package-lock.json && npm cache clean --force
# Install dependencies
RUN npm install --legacy-peer-deps
# Copy the rest of the application code
COPY . .
# Expose the port the app will run on
EXPOSE 8080
# Command to start the application
CMD ["node", "index.js"]

14
index.js Normal file
View File

@ -0,0 +1,14 @@
const express = require("express");
const app = express();
const PORT = 8080;
// Simple "Hello, World!" route
app.get("*", (req, res) => {
res.send("Hello, World!");
});
// Start server
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});