-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hot-reload functionality for local k8s
When the local-kubernetes provider is used, container modules can now be configured to hot-reload their running services when the module's sources change (i.e. without redeploying). Services that can be run with an FS watcher that automatically applies changed sources to the running application (e.g. nodemon and many other web app frameworks) are a natural fit for this feature.
- Loading branch information
Showing
59 changed files
with
6,272 additions
and
178 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
Dockerfile | ||
garden.yml | ||
app.yaml |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM node:9-alpine | ||
|
||
ENV PORT=8080 | ||
EXPOSE ${PORT} | ||
|
||
ADD . /app | ||
WORKDIR /app | ||
|
||
RUN npm install -g nodemon | ||
RUN npm install | ||
|
||
CMD ["npm", "start"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const express = require("express") | ||
|
||
const app = express() | ||
|
||
app.get("/dependant", (req, res) => { | ||
res.json({message: "Build dependant"}) | ||
}) | ||
|
||
// This is the path GAE uses for health checks | ||
app.get("/_ah/health", (req, res) => { | ||
res.sendStatus(200) | ||
}) | ||
|
||
module.exports = { app } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module: | ||
description: Build dependant | ||
name: build-dependant | ||
type: container | ||
services: | ||
- name: build-dependant | ||
command: [npm, start] | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
ingresses: | ||
- path: /dependant | ||
port: http | ||
healthCheck: | ||
httpGet: | ||
path: /_ah/health | ||
port: http | ||
build: | ||
dependencies: | ||
- good-morning |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const { app } = require("./app") | ||
|
||
app.listen(process.env.PORT, "0.0.0.0", () => console.log("App started")) |
Oops, something went wrong.