Skip to content

Commit

Permalink
fix(119): ulimit is optional (not enabled by default) (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom-x committed May 12, 2023
1 parent 6754e37 commit 36856fe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ ENV SERVICE_ENABLE_IMPORT_OVER_NETCAT false
ENV SERVICE_ENABLE_ADSBEXCHANGE false
ENV SERVICE_ENABLE_PLANEFINDER false

# System properties
ENV ULIMIT_N -1

LABEL maintainer="maugin.thomas@gmail.com"

# COPY ALL
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ See: https://openweathermap.org/price

Ex : `-e "LAYERS_OWM_API_KEY=dsf1ds65f4d2f65g"`

## System:

| Environment Variable | Default value | Description |
| ---------------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `ULIMIT_N` | -1 | Enforce ulimit like docker <=22 to prevent OOM issues (-1 mean not enforced), recommended value when crash 1048576 |

Ex : `-e "ULIMIT_N=1048576"`

# Build it yourself

Clone this repo.
Expand Down
4 changes: 3 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/http/run
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ if [ "$SERVICE_ENABLE_HTTP" != "false" ]; then

# enforce ulimit like docker <=22 to prevent OOM issues
# see https://github.com/Thom-x/docker-fr24feed-piaware-dump1090/issues/107
ulimit -n 1048576
if [ "$ULIMIT_N" != "-1" ]; then
ulimit -n "$ULIMIT_N"
fi

/thttpd -D -h 0.0.0.0 -p 8080 -d /usr/lib/fr24/public_html -l - -M 60 2>&1 | mawk -W interactive '{printf "%c[32m[http]%c[0m %s\n", 27, 27, $0}'
# stdbuf ... -- (remove blank lines from output)
Expand Down

0 comments on commit 36856fe

Please sign in to comment.