Comments (1)
Came across the same issue for the distroless images and solved it by creating a modified Docker image with a built-in node-based health check for Soketi:
- Create a health check script for Node.
// healthcheck.js
#!/usr/bin/env node
const http = require('node:http');
const options = {
hostname: 'localhost',
port: process.env.SOKETI_PORT || 6001,
path: '/',
method: 'GET'
};
http.request(options, res => {
let body = '';
res.on('data', chunk => {
body += chunk;
});
res.on('end', () => {
if (body === 'OK') {
process.stdout.write('We are healthy!');
process.exit(0);
} else {
process.stdout.write('Uh oh, we are not healthy!');
process.exit(1);
}
});
})
.on('error', () => {
process.stdout.write('Uh oh, we are not healthy!');
process.exit(1);
})
.end();
- Create a Dockerfile based off the distroless Soketi image:
# Dockerfile
FROM quay.io/soketi/soketi:1.6-16-distroless
COPY docker/healthcheck.js /app/
- Build the Docker image:
docker build -t soketi-with-healthcheck .
- After building and running the Docker image, you can perform the healthcheck by running:
docker exec -i -t soketi-with-healthcheck /nodejs/bin/node healthcheck.js
Or if you're deploying the Docker container in AWS ECS for example, define the healthcheck in your container task definition like this:
HealthCheck:
Command: [ "CMD", "/nodejs/bin/node", "healthcheck.js" ]
Interval: 5
Retries: 3
Timeout: 2
from soketi.
Related Issues (20)
- [BUG] Metrics - process uncaughtException HOT 1
- Cloudflare Token is not valid. HOT 5
- Is there any way to use server sent events (sse) with soketi? HOT 2
- [REQUEST]: App ID & Secret HOT 4
- [BUG] Soketi Does Not Connect HOT 1
- [BUG] Soketi not starting on nodejs major v20 HOT 10
- [BUG] Duplicate messages being sent to client HOT 2
- [REQUEST] Consider using DragonflyDB and/or KeyDB instead of Redis HOT 2
- [REQUEST] Force Dockerfile.debian to VERSION 16 HOT 2
- EVENT_MAX_SIZE_IN_KB is not working in docker soketi HOT 1
- [BUG] queue redis driver HOT 2
- [REQUEST] Add Support for json export of metrics and usage HOT 1
- [BUG] I can't seem to install soketi in pnpm v8.12 and node v20 HOT 1
- Can't deploy it with ssl and nginx HOT 3
- soketi can not working in Docker ? HOT 5
- https://dash.soketi.app/register seems to be down HOT 7
- [REQUEST] Metrics direct logging? HOT 1
- [REQUEST] Laravel echo now requires a "cluster" option for socketi client HOT 4
- https://dash.soketi.app/ seems to be down. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soketi.