Created
May 14, 2019 23:25
-
-
Save jthegedus/b006fbf1fb970fb277c72d638fa6079e to your computer and use it in GitHub Desktop.
Berglas w Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:10-alpine | |
RUN apk add ca-certificates | |
ENV NODE_ENV=production | |
WORKDIR /urs/src/app | |
COPY package.json yarn.lock ./ | |
RUN yarn install --production | |
COPY . ./ | |
COPY --from=gcr.io/berglas/berglas:latest /bin/berglas /bin/berglas | |
ENTRYPOINT exec /bin/berglas exec -- yarn start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "src", | |
"version": "0.0.12", | |
"main": "src/function.js", | |
"license": "MIT", | |
"scripts": { | |
"start": "functions-framework --target=helloBerglas" | |
}, | |
"dependencies": { | |
"@google-cloud/functions-framework": "^1.1.0" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.helloBerglas = (req, res) => { | |
let data = '<h1>Berglas Test</h1>'; | |
data += `<p>nsecret is ${process.env.API_KEY}</p>`; | |
data += `<p>listening on port ${process.env.PORT}</p>`; | |
res.send(data); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment