Skip to content

Commit

Permalink
openfaas: Support OpenFaaS Cloud
Browse files Browse the repository at this point in the history
Relate-to: github.com/openfaas/openfaas-cloud/pull/523
Change-Id: I49ca87f508a52e922414f86cbce2e40487fb023a
Signed-off-by: Philippe Coval <p.coval@samsung.com>
  • Loading branch information
rzr committed Oct 16, 2019
1 parent 94d6783 commit 5f98242
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
28 changes: 28 additions & 0 deletions extra/tools/openfaas/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/echo docker build . -f
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
#{
# Copyright 2019-present Samsung Electronics France SAS, and other contributors
#
# This Source Code Form is subject to the terms of the MIT Licence
# If a copy of the MIT was not distributed with this file
# You can obtain one at:
# https://spdx.org/licenses/MIT.html
#}

FROM rzrfreefr/iotjs-express:latest
LABEL maintainer "Philippe Coval (p.coval@samsung.com)"

ENV project iotjs-express-openfaas
COPY . /usr/local/opt/${project}/src/${project}/
WORKDIR /usr/local/opt/${project}/src/${project}/

ADD https://github.com/openfaas/faas/releases/download/0.6.9/fwatchdog /usr/bin
RUN chmod +x /usr/bin/fwatchdog

ENV read_timeout="60"
ENV write_timeout="60"
ENV fprocess="xargs iotjs --help"

HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
CMD [ "fwatchdog" ]
5 changes: 5 additions & 0 deletions extra/tools/openfaas/handler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"use strict"

module.exports = (context, callback) => {
callback(undefined, {status: "done"});
}
12 changes: 12 additions & 0 deletions extra/tools/openfaas/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "function",
"version": "1.0.0",
"description": "",
"main": "handler.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
9 changes: 9 additions & 0 deletions stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 1.0
provider:
name: openfaas
gateway: http://127.0.0.1:8080
functions:
stack:
lang: node
handler: ./extra/tools/openfaas
image: rzrfreefr/iotjs-express:latest

0 comments on commit 5f98242

Please sign in to comment.