test
This commit is contained in:
commit
009b206769
|
|
@ -0,0 +1,3 @@
|
||||||
|
/node_modules
|
||||||
|
package.json
|
||||||
|
package-lock.json
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
app: "dec26"
|
||||||
|
region: "asia-south1"
|
||||||
|
entrypoint: "index.js"
|
||||||
|
|
||||||
|
build:
|
||||||
|
builtin: dockerfile
|
||||||
|
ignorefile: .gitignore
|
||||||
|
|
||||||
|
env:
|
||||||
|
PORT: '8080'
|
||||||
|
|
@ -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"]
|
||||||
|
|
@ -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}`);
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue
Block a user