This commit is contained in:
Jared Furlow 2025-05-03 12:25:22 -05:00
commit 49fc7d42ab
5 changed files with 42 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.DS_Store
node_modules

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM node:23.6-bullseye-slim
RUN apt-get update && apt-get install curl -y
WORKDIR /opt/prod/app
COPY . .
RUN npm install
EXPOSE 3000
CMD [ "node", "dist/start.js" ]

13
compose.yaml Normal file
View File

@ -0,0 +1,13 @@
services:
http-server:
build:
context: .
dockerfile: ./Dockerfile
healthcheck:
test:
- CMD
- curl
- 'http://127.0.0.1:3000/test'
interval: 2s
timeout: 10s
retries: 15

9
dist/start.js vendored Normal file
View File

@ -0,0 +1,9 @@
const express = require("express");
const app = express();
app.get("/test", async function (req, res) {
res.send(`Testing ${new Date().toLocaleTimeString()}<br><pre>${JSON.stringify(req)}</pre>`)
});
app.listen(3000);

8
package.json Normal file
View File

@ -0,0 +1,8 @@
{
"name": "localtest.jdf2.org",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"express": "^4.17.1"
}
}