I currently have this setup which works:
Dockerfile:
ENTRYPOINT [ "/start.sh" ]`
start.sh:
#Also redirects stdout and stderr to catalina log file. This will essentially keep the container alive.
/usr/local/tomcat/bin/catalina.sh run &> "/usr/local/tomcat/logs/catalina.out"
However, I would like to avoid all the logs being outputted to catalina.out. However, if I remove that part, the container will simply just exit immediatly. I then learned that it should be possible to avoid that using ENTRYPOINT. So I have tried this (and many other things it feels like)
Dockerfile:
#First run the startup script and then start tomcat
ENTRYPOINT ["/bin/sh", "-c", "/start.sh && /usr/local/tomcat/bin/catalina.sh run"]
start.sh:
printf "Start script done\n"
When I run the container, I can see that “Start script done” is printed. Tomcat is started and my application starts to load. But then the container shuts down with exit code 37. What am I doing wrong here? I cannot seem to be able to figure it out. I understand that code 37 has to do with memory? It does not make any sense to me as my previous setup always worked completely fine without memory issues.