Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

build: update sst health checks

Brad Barbinfeaa44dca448
diff --git a/apps/erp/Dockerfile b/apps/erp/Dockerfile
index 55d57d15bd..0b1a1566af 100644
--- a/apps/erp/Dockerfile
+++ b/apps/erp/Dockerfile
@@ -16,8 +16,11 @@ FROM node:20
WORKDIR /repo
ENV NODE_ENV=production
ENV PORT=3000
-# Production needs only built app + node_modules
+# Install curl for health checks
+RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
+# Production needs built app, node_modules, and packages (for workspace deps)
COPY --from=deps /repo/node_modules ./node_modules
+COPY --from=deps /repo/packages ./packages
COPY --from=build /repo/apps/erp ./apps/erp
EXPOSE 3000
WORKDIR /repo/apps/erp
diff --git a/apps/mes/Dockerfile b/apps/mes/Dockerfile
index 20e08a1457..9930a98a16 100644
--- a/apps/mes/Dockerfile
+++ b/apps/mes/Dockerfile
@@ -16,8 +16,11 @@ FROM node:20
WORKDIR /repo
ENV NODE_ENV=production
ENV PORT=3000
-# Production needs only built app + node_modules
+# Install curl for health checks
+RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
+# Production needs built app, node_modules, and packages (for workspace deps)
COPY --from=deps /repo/node_modules ./node_modules
+COPY --from=deps /repo/packages ./packages
COPY --from=build /repo/apps/mes ./apps/mes
EXPOSE 3001
WORKDIR /repo/apps/mes
diff --git a/sst.config.ts b/sst.config.ts
index 0efc3182c8..a707319b23 100644
--- a/sst.config.ts
+++ b/sst.config.ts
@@ -27,6 +27,13 @@ export default $config({
{ listen: "80/http", redirect: "443/https" },
{ listen: "443/https", forward: "3000/http" },
],
+ health: {
+ path: "/health",
+ interval: "60 seconds",
+ timeout: "30 seconds",
+ healthyThreshold: 2,
+ unhealthyThreshold: 5,
+ },
},
health: {
command: [
@@ -102,6 +109,13 @@ export default $config({
{ listen: "80/http", redirect: "443/https" },
{ listen: "443/https", forward: "3000/http" },
],
+ health: {
+ path: "/health",
+ interval: "60 seconds",
+ timeout: "30 seconds",
+ healthyThreshold: 2,
+ unhealthyThreshold: 5,
+ },
},
health: {
command: [