mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 04:56:38 +00:00
Light-weight examples for HelloWorld - for on reading an input/request.
This commit is contained in:
sample-functions/BaseFunctions
15
sample-functions/BaseFunctions/python/Dockerfile
Normal file
15
sample-functions/BaseFunctions/python/Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
FROM python:2.7-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 handler.py .
|
||||
|
||||
ENV fprocess="python handler.py"
|
||||
|
||||
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
|
||||
|
||||
CMD ["fwatchdog"]
|
||||
|
5
sample-functions/BaseFunctions/python/build.sh
Executable file
5
sample-functions/BaseFunctions/python/build.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Building functions/python:2.7-alpine"
|
||||
docker build -t functions/python:2.7-alpine .
|
||||
|
11
sample-functions/BaseFunctions/python/handler.py
Normal file
11
sample-functions/BaseFunctions/python/handler.py
Normal file
@ -0,0 +1,11 @@
|
||||
import sys
|
||||
|
||||
def get_stdin():
|
||||
buf = ""
|
||||
for line in sys.stdin:
|
||||
buf = buf + line
|
||||
return buf
|
||||
|
||||
if(__name__ == "__main__"):
|
||||
st = get_stdin()
|
||||
print(st)
|
Reference in New Issue
Block a user