Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- build(deps): use elixir 1.18.4, node 22 & debian trixie (#4889 - @swiffer)
- fix: allow using different PostgreSQL port than default when using socket_dir connection (#4979 - @jaypark0006)
- perf: use anti join for short-circuit evaluation when getting non streamed drives (#4990 - @swiffer)
- feat: Add ulimit cap to prevent memory bloat in some misconfigured versions of Docker/containerd Hosts (e.g. on Debian 13) (#5025 - @JakobLichterfeld)

#### Build, CI, internal

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ RUN mkdir $SRTM_CACHE

EXPOSE 4000

ENTRYPOINT ["tini", "--", "/bin/sh", "/entrypoint.sh"]
ENTRYPOINT ["tini", "--", "/bin/dash", "/entrypoint.sh"]
CMD ["bin/teslamate", "start"]
9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/usr/bin/env sh
#!/usr/bin/env dash
set -e

: "${DATABASE_HOST:="127.0.0.1"}"
: "${DATABASE_PORT:=5432}"
: "${ULIMIT_MAX_NOFILE:=65536}"

# prevent memory bloat in some misconfigured versions of Docker/containerd
# where the nofiles limit is very large. 0 means don't set it.
if test "${ULIMIT_MAX_NOFILE}" != 0 && test "$(ulimit -n)" -gt "${ULIMIT_MAX_NOFILE}"; then
ulimit -n "${ULIMIT_MAX_NOFILE}"
fi

# wait until Postgres is ready
while ! nc -z "${DATABASE_HOST}" "${DATABASE_PORT}" 2>/dev/null; do
Expand Down
1 change: 1 addition & 0 deletions website/docs/configuration/environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ TeslaMate accepts the following environment variables for runtime configuration:
| **POLLING_MINIMUM_INTERVAL** | Minimum interval between API fetch. No minimum by default. **Important: Do not alter this setting unless you are certain of the implications.** | 0 |
| **HTTP_POOL_SIZE** | The default size of the HTTP connection pool for domains other than `TESLA_API_HOST`, `nominatim.openstreetmap.org`, and `api.github.com`. This setting determines the maximum number of simultaneous connections allowed for these domains. | 5 |
| **HTTP_POOL_TIMEOUT** | The maximum time (in microseconds) to wait for a connection from the HTTP pool before timing out. This setting helps prevent indefinite waits when the pool is exhausted. | 10000 |
| **ULIMIT_MAX_NOFILE** | Sets the maximum number of open file descriptors for the TeslaMate process. This can prevent memory bloat in environments with very high default `ulimit` values. Set to `0` to disable this feature. | 65536 |
| **NOMINATIM_PROXY** | HTTP proxy for OpenStreetMap Nominatim API requests (e.g. `http://127.0.0.1:7897`, HTTP only). Similar to [`nominatim_http_proxy`](https://nominatim.org/release-docs/latest/customize/Settings/#nominatim_http_proxy). | |
Loading