Moving out the cat service as an example.

This commit is contained in:
Alex
2017-01-03 23:31:55 +00:00
parent f9fd0a08b5
commit bdfdd5ad45
7 changed files with 40 additions and 37 deletions

View File

@ -0,0 +1,9 @@
FROM alpine:latest
ENTRYPOINT []
COPY ./fwatchdog /usr/bin/fwatchdog
ENV fprocess "cat"
EXPOSE 8080
CMD ["/usr/bin/fwatchdog"]

View File

@ -0,0 +1,17 @@
* Build the watchdog app which outputs fwatchdog
* Copy fwatchdog to the directory of each function you want to build.
* Create a service for each function:
```
# docker build -t catservice .
# docker service rm catservice ; docker service create --network=functions --name catservice catservice
```
* Consume it like this:
```
# curl -X POST -d @$HOME/.ssh/id_rsa.pub -H "X-Function: catservice" localhost:8080/
ssh-rsa AAAAB3NzaC1yc2....
```