Skip to content

Commit

Permalink
🩺 Add healthcheck directly on container
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Dec 18, 2024
1 parent 46a2153 commit 15b5e24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion infra/erpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,17 @@ export const erpcService = new SstService("Erpc", {
image: image.imageUri,
// Scaling options
scaling: {
min: 1,
// todo: Min two instance since current version keep failing idk why
min: 2,
max: 4,
cpuUtilization: 80,
memoryUtilization: 80,
},
// Container health check
health: {
command: ["CMD-SHELL", "curl -f http://localhost:8080/healthcheck || exit 1"],
startPeriod: "15 seconds"
},
// Logging options
logging: {
retention: "3 days",
Expand Down
3 changes: 3 additions & 0 deletions packages/erpc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ RUN cd /tmp/dev && bun build --outfile ./erpc.js --minify --target node --extern
#FROM erpc-dev AS final
FROM ghcr.io/erpc/erpc@sha256:c62bd25d011cb0cf354689685edcf81ef49480c532d7b980a1f4cf0be3bdd0ea AS final

# Install curl, will be used for healthcheck
RUN apt-get update && apt-get install -y curl

# Copy the bundled config
COPY --from=bundler ./tmp/dev/erpc.js /root/erpc.js

Expand Down

0 comments on commit 15b5e24

Please sign in to comment.