Files
fn-serverless/cli/langs/node.go
Travis Reeder 48e3781d5e Rename to GitHub (#3)
* circle

* Rename to github and fn->cli

*  Rename to github and fn->cli
2017-07-26 10:50:19 -07:00

35 lines
661 B
Go

package langs
type NodeLangHelper struct {
BaseHelper
}
func (lh *NodeLangHelper) BuildFromImage() string {
return "funcy/node:dev"
}
func (lh *NodeLangHelper) RunFromImage() string {
return "funcy/node"
}
func (lh *NodeLangHelper) Entrypoint() string {
return "node func.js"
}
func (h *NodeLangHelper) DockerfileBuildCmds() []string {
r := []string{}
if exists("package.json") {
r = append(r,
"ADD package.json /function/",
"RUN npm install",
)
}
return r
}
func (h *NodeLangHelper) DockerfileCopyCmds() []string {
return []string{
"ADD . /function/",
"COPY --from=build-stage /function/node_modules/ /function/node_modules/",
}
}