I have an application running nodejs and redis services. The exposed port is only 3000. This application is an api that queries and stores data in a postgresql.
The services run in a single container.
My problem is that when I check the system log, I keep getting liveness, readiness and startup errors, even though I already have them configured.
So I wanted to know if anyone has had this problem and how to solve it.
I have the ingress type enabled and http type.
Another important thing to mention is that this application will be receiving approximately 150,000 requests per day.
Thanks!
This is the configuration I currently have:
Configuration of health probes
My Dockerfile
FROM node:21.4-bookworm
RUN apt-get update &&
apt-get install -y iputils-ping traceroute telnet dnsutils git nano htop redis-server &&
npm install -g pm2 &&
ln -fs /usr/share/zoneinfo/America/Santiago /etc/localtime &&
rm -rf /var/lib/apt/lists/*
RUN echo "user1:password" | chpasswd
RUN adduser -u 2000 user2 &&
echo "user2:password" | chpasswd
WORKDIR /usr/src/app/CUA-Tunel
COPY . .
EXPOSE 3000
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
My entrypoint
#!/bin/bash
# ConfiguraciĆ³n DNS
echo search server01.domain.com > /etc/resolv.conf
echo search server02.domain.com >> /etc/resolv.conf
echo "nameserver xxx.xxx.xxx.xxx" >> /etc/resolv.conf
echo "nameserver xxx.xxx.xxx.xxx" >> /etc/resolv.conf
echo "maxclients 500000" >> /etc/redis/redis.conf
npm install
/etc/init.d/redis-server start
npx pm2 start ecosystem.config.js --no-daemon
My compose
#version: '2.0'
services:
tunel-nodejs:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"