Express runtime working
This commit is contained in:
20
runtimes/express/Dockerfile.j2
Normal file
20
runtimes/express/Dockerfile.j2
Normal file
@ -0,0 +1,20 @@
|
||||
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as build
|
||||
|
||||
RUN apk update && apk upgrade && apk add nodejs npm {{ ship_packages | join(" ") }} {{ devel_packages | join(" ") }} && apk cache clean
|
||||
|
||||
WORKDIR /home/app
|
||||
|
||||
COPY ./ ./
|
||||
RUN npm i
|
||||
|
||||
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship
|
||||
RUN apk update && apk upgrade && apk add nodejs curl {{ ship_packages | join " " }} && apk cache clean
|
||||
RUN addgroup -S app && adduser app -S -G app
|
||||
|
||||
WORKDIR /home/app
|
||||
USER app
|
||||
|
||||
COPY --from=build /home/app/ .
|
||||
|
||||
CMD ["node", "funko.js"]
|
||||
HEALTHCHECK {{ healthcheck_options }} CMD {{ healthcheck_command }}
|
15
runtimes/express/template/funko.js
Normal file
15
runtimes/express/template/funko.js
Normal file
@ -0,0 +1,15 @@
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
const port = 3000
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello World!')
|
||||
})
|
||||
|
||||
app.get('/ping', (req, res) => {
|
||||
res.send('OK')
|
||||
})
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Example funko listening on port ${port}`)
|
||||
})
|
2
runtimes/express/template/funko.yml.j2
Normal file
2
runtimes/express/template/funko.yml.j2
Normal file
@ -0,0 +1,2 @@
|
||||
name: {{ name }}
|
||||
runtime: {{ runtime }}
|
11
runtimes/express/template/package.json.j2
Normal file
11
runtimes/express/template/package.json.j2
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "{{name}}",
|
||||
"version": "1.0.0",
|
||||
"main": "funko.js",
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"description": "Example Funko",
|
||||
"dependencies": {
|
||||
"express": "^4.19.2"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user