fix: increase ulimit -n in docker

This commit is contained in:
Gergő Móricz 2024-09-27 20:44:52 +02:00
parent d5e2a80e4a
commit f0a1a2e45b
2 changed files with 21 additions and 1 deletions

View File

@ -37,4 +37,6 @@ COPY --from=go-base /app/src/lib/go-html-to-md/html-to-markdown.so /app/dist/src
# Start the server by default, this can be overwritten at runtime
EXPOSE 8080
ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"
ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"
ENTRYPOINT "/app/docker-entrypoint.sh"

18
apps/api/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash -e
if [ $UID -eq 0 ]; then
ulimit -n 65535
echo "NEW ULIMIT: $(ulimit -n)"
else
echo ENTRYPOINT DID NOT RUN AS ROOT
fi
if [ $FLY_PROCESS_GROUP -eq "app" ]; then
node --max-old-space-size=8192 dist/src/index.js
elif [ $FLY_PROCESS_GROUP -eq "worker" ]; then
node --max-old-space-size=8192 dist/src/services/queue-worker.js
else
echo "NO FLY PROCESS GROUP, RUNNING app BY DEFAULT"
node --max-old-space-size=8192 dist/src/index.js
fi