typesense / typesense/typesense

[Feature Request] Run production Docker containers as a non-privileged user

Open
#2,941 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
26.6k
Forks
973
Avg merge
18h 45m
Merged PRs (30d)
4

Description

Describe your feature request
Current Dockerfiles (specifically 'docker/deployment.Dockerfile') lack a 'USER' instruction, causing the Typesense server process to run as 'root' by default. Adding a non-privileged user (e.g., 'typesense') and switching to it would align the project with security best practices for containerized applications.

Please describe your use-case for the feature request
Running as a non-root user provides an essential layer of defense-in-depth. In the event of a potential process breakout or container escape vulnerability, having the process restricted to a non-privileged user significantly limits the potential impact on the host system and other containers.

Describe alternatives you've considered
Using a custom entrypoint script to handle user creation and permission management at runtime is an alternative, but a declarative 'USER' instruction in the Dockerfile is generally more transparent and easier for security scanners to validate.

Additional context
Implementation would require ensuring the 'typesense' user has appropriate permissions on data and log volumes. Discussion on whether this should be a breaking change or a new tagged image (e.g., ':latest-nonroot') would be beneficial.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review docker/deployment.Dockerfile and the data and log volume requirements described in the issue. Determine how the proposed typesense user should access those volumes and whether the change belongs in the existing image or a separate tag. Done means production containers run the server as non-root while retaining required data and log access.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
devops, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.