Initial commit for serverless

This commit is contained in:
Kajal Thakur 2025-01-23 16:58:04 +05:30
commit fc9cf9fffe
4 changed files with 65 additions and 0 deletions

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"]

10
boltic.yaml Normal file
View File

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

15
index.js Normal file
View File

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

16
package.json Normal file
View File

@ -0,0 +1,16 @@
{
"name": "dummy",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.21.2"
}
}