Next.js Discord

Discord Forum

Infinite loop requests on docker container but not locally NextJs

Unanswered
se7t lil posted this in #help-forum
Open in Discord
requests work just fine locally but when i run docker i sometimes get infinite loops of the same requests , any idea why does that happen ? did anybody face this issue before

10 Replies

@Ray do you get any error in the container?
the container crashes ://
I think you can still check the log?
its just that sometimes a request fails that never used to locally and then the container crashes or theres an infinite loop until the container crashes with no errors just container exit code 1
could you show your dockerfile?
replaces this one
FROM node:20.6-alpine as base

RUN apk add --no-cache \
python3 \
make \
g++

WORKDIR /app

COPY package*.json ./

RUN npm install && npm install --dev

COPY . .

RUN chmod 777 ./run.sh

ENTRYPOINT ["sh", "run.sh"]
with this one
FROM node:20.6-alpine as base

RUN apk add --no-cache tini

RUN apk add --no-cache \
python3 \
make \
g++

WORKDIR /app

COPY package*.json ./

RUN npm install && npm install --dev

COPY . .

RUN chmod 777 ./run.sh

ENTRYPOINT ["/sbin/tini", "--", "sh", "run.sh"]
to stop the issue but now we kinda face a weird behavior where the container seems to have stopped because service doesnt work anymore but when we check logs and docker desktop app it doesnt show as stopped
sure ill try it out and see if it fixes the issue , thanks !!