From e1641e42d88a41f78c8a059e3bcf878d6b05e0ef Mon Sep 17 00:00:00 2001 From: anujsahu Date: Mon, 16 Mar 2026 20:22:16 +0530 Subject: [PATCH] 1st --- .dockerignore | 2 ++ Dockerfile | 10 ++++++++++ app.js | 17 +++++++++++++++++ boltic-properties.yaml | 36 ++++++++++++++++++++++++++++++++++++ package.json | 9 +++++++++ 5 files changed, 74 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 app.js create mode 100644 boltic-properties.yaml create mode 100644 package.json diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..93f1361 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d0f84c4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY package.json ./ +COPY app.js ./ + +EXPOSE 8080 + +CMD ["node", "app.js"] diff --git a/app.js b/app.js new file mode 100644 index 0000000..c01ffd0 --- /dev/null +++ b/app.js @@ -0,0 +1,17 @@ +const http = require('http'); + +const PORT = 8080; + +const server = http.createServer((req, res) => { + if (req.method === 'GET' && req.url === '/') { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('3rd updateee Hello World'); + } else { + res.writeHead(404, { 'Content-Type': 'text/plain' }); + res.end('Not Found'); + } +}); + +server.listen(PORT, () => { + console.log(`Server running on port ${PORT}`); +}); diff --git a/boltic-properties.yaml b/boltic-properties.yaml new file mode 100644 index 0000000..bcecc6f --- /dev/null +++ b/boltic-properties.yaml @@ -0,0 +1,36 @@ +app: "anujbugtest" +serverlessId: "ce200692-ad45-4edd-b63b-f052f7ce51bb" +region: "asia-south1" +handler: "handler.handler" +language: "nodejs/20" + +serverlessConfig: + Name: "anujbugtest" + Description: "" + Runtime: "git" + # Environment variables for your serverless function + # To add env variables, replace {} with key-value pairs like: + # Env: + # API_KEY: "your-api-key" + #TO add port map, replace {} with port map like: + # PortMap: + # - Name: "port" + # Port: "8080" + # Protocol: "http"/"https" + Env: {} + PortMap: {} + Scaling: + AutoStop: false + Min: 1 + Max: 1 + MaxIdleTime: 300 + Resources: + CPU: 0.1 + MemoryMB: 128 + MemoryMaxMB: 128 + Timeout: 60 + Validations: null + +build: + builtin: dockerfile + ignorefile: .gitignore diff --git a/package.json b/package.json new file mode 100644 index 0000000..d61e7e6 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "name": "hello-world-app", + "version": "1.0.0", + "description": "Simple Node.js Hello World app", + "main": "app.js", + "scripts": { + "start": "node app.js" + } +}