mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 08:46:48 +00:00
New and updated sample function Dockerfiles & deleted NodeBaseFunction
Signed-off-by: rgee0 <richard@technologee.co.uk>
This commit is contained in:
parent
f43dc49db0
commit
1cd7ce2449
@ -1,8 +1,9 @@
|
|||||||
FROM armhf/alpine:3.5
|
FROM arm32v6/alpine:3.6
|
||||||
|
|
||||||
ADD https://github.com/alexellis/faas/releases/download/v0.3-alpha/fwatchdog-armhf /usr/bin/fwatchdog
|
ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog
|
||||||
RUN chmod +x /usr/bin/fwatchdog
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
|
||||||
# Populate example here
|
# Populate example here
|
||||||
# ENV fprocess="wc -l"
|
# ENV fprocess="wc -l"
|
||||||
|
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
|
||||||
CMD ["fwatchdog"]
|
CMD ["fwatchdog"]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk --update add nodejs
|
RUN apk --update add nodejs nodejs-npm
|
||||||
|
|
||||||
ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
|
ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
|
||||||
RUN chmod +x /usr/bin/fwatchdog
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk --update add nodejs
|
RUN apk --update add nodejs nodejs-npm
|
||||||
|
|
||||||
ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
|
ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
|
||||||
#COPY ./fwatchdog /usr/bin/
|
#COPY ./fwatchdog /usr/bin/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk --update add nodejs
|
RUN apk --update add nodejs nodejs-npm
|
||||||
|
|
||||||
ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
|
ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
|
||||||
RUN chmod +x /usr/bin/fwatchdog
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
FROM armhf/alpine:3.5
|
FROM arm32v6/alpine:3.6
|
||||||
|
|
||||||
ADD https://github.com/alexellis/faas/releases/download/0.5.4-alpha/fwatchdog-armhf /usr/bin/fwatchdog
|
ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog
|
||||||
RUN chmod +x /usr/bin/fwatchdog
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
FROM node:6.9.1-alpine
|
|
||||||
|
|
||||||
ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin
|
|
||||||
RUN chmod +x /usr/bin/fwatchdog
|
|
||||||
|
|
||||||
WORKDIR /root/
|
|
||||||
|
|
||||||
COPY package.json .
|
|
||||||
|
|
||||||
# Provides a boot-strap into your function, just add handler.js to derived image
|
|
||||||
RUN npm i
|
|
||||||
COPY faas_index.js .
|
|
||||||
|
|
||||||
ENV fprocess="node faas_index.js"
|
|
||||||
|
|
||||||
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
|
|
||||||
|
|
||||||
CMD ["fwatchdog"]
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "Building functions/nodebase:alpine-6.9.1"
|
|
||||||
docker build -t functions/nodebase:alpine-6.9.1 .
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
"use strict"
|
|
||||||
|
|
||||||
let getStdin = require('get-stdin');
|
|
||||||
|
|
||||||
let handler = require('./handler');
|
|
||||||
|
|
||||||
getStdin().then(val => {
|
|
||||||
|
|
||||||
let req;
|
|
||||||
if(process.env.json) {
|
|
||||||
req = JSON.parse(val);
|
|
||||||
} else {
|
|
||||||
req = val
|
|
||||||
}
|
|
||||||
|
|
||||||
handler(req, (err, res) => {
|
|
||||||
if(err) {
|
|
||||||
return console.error(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(process.env.json) {
|
|
||||||
console.log(JSON.stringify(res));
|
|
||||||
} else {
|
|
||||||
console.log(res);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).catch(e => {
|
|
||||||
console.error(e.stack);
|
|
||||||
});
|
|
@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "NodejsBase",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "",
|
|
||||||
"main": "faas_index.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"keywords": [],
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"get-stdin": "^5.0.1"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk --update add nodejs
|
RUN apk --update add nodejs nodejs-npm
|
||||||
|
|
||||||
ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog /usr/bin
|
ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog /usr/bin
|
||||||
RUN chmod +x /usr/bin/fwatchdog
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
FROM armhf/alpine:latest
|
FROM arm32v6/alpine:latest
|
||||||
RUN apk --no-cache add nodejs
|
RUN apk --no-cache add nodejs nodejs-npm
|
||||||
|
|
||||||
COPY fwatchdog-armhf /usr/bin/fwatchdog
|
ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog
|
||||||
RUN chmod +x /usr/bin/fwatchdog
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
|
||||||
COPY package.json .
|
COPY package.json .
|
||||||
COPY main.js .
|
COPY main.js .
|
||||||
RUN npm i
|
RUN npm i
|
||||||
ENV fprocess="node main.js"
|
ENV fprocess="node main.js"
|
||||||
|
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
|
||||||
CMD ["fwatchdog"]
|
CMD ["fwatchdog"]
|
||||||
|
13
sample-functions/ResizeImageMagick/Dockerfile.armhf
Normal file
13
sample-functions/ResizeImageMagick/Dockerfile.armhf
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
FROM arm32v6/alpine:3.6
|
||||||
|
|
||||||
|
RUN apk --no-cache add imagemagick
|
||||||
|
|
||||||
|
ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog
|
||||||
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
|
||||||
|
ENV fprocess "convert - -resize 50% fd:1"
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
|
||||||
|
CMD [ "/usr/bin/fwatchdog"]
|
4
sample-functions/ResizeImageMagick/build.armhf.sh
Normal file
4
sample-functions/ResizeImageMagick/build.armhf.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "Building functions/resizer:armhf..."
|
||||||
|
docker build -t functions/resizer:armhf -f Dockerfile.armhf .
|
@ -1,6 +1,7 @@
|
|||||||
FROM python:2.7-alpine
|
FROM python:2.7-alpine
|
||||||
RUN pip install textblob
|
|
||||||
RUN python -m textblob.download_corpora
|
RUN pip install textblob && \
|
||||||
|
python -m textblob.download_corpora
|
||||||
|
|
||||||
ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin
|
ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin
|
||||||
RUN chmod +x /usr/bin/fwatchdog
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
17
sample-functions/SentimentAnalysis/Dockerfile.armhf
Normal file
17
sample-functions/SentimentAnalysis/Dockerfile.armhf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM arm32v7/python:2.7-slim
|
||||||
|
|
||||||
|
RUN pip install textblob && \
|
||||||
|
python -m textblob.download_corpora
|
||||||
|
|
||||||
|
ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog
|
||||||
|
RUN chmod +x /usr/bin/fwatchdog
|
||||||
|
|
||||||
|
WORKDIR /root/
|
||||||
|
|
||||||
|
COPY handler.py .
|
||||||
|
|
||||||
|
ENV fprocess="python handler.py"
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
|
||||||
|
|
||||||
|
CMD ["fwatchdog"]
|
5
sample-functions/SentimentAnalysis/build.armhf.sh
Normal file
5
sample-functions/SentimentAnalysis/build.armhf.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "Building functions/sentimentanalysis:armhf..."
|
||||||
|
docker build -t functions/sentimentanalysis:armhf . -f Dockerfile.armhf
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user