Recent Chats
Sign in to access your chat history.
Can I run Sourcebot as a non root user?
Details
Answer
Yes, Sourcebot supports running as a non-root user! This feature was added in v4.9.1 as noted in the changelog CHANGELOG.md:479-482.
The Dockerfile creates a dedicated sourcebot user (UID 1500, GID 1500 by default) during the image build Dockerfile:185-197. This user is added to the postgres, redis, and node groups so it can interact with the embedded services.
By default, the container runs as root for backwards compatibility — the USER directive is intentionally commented out Dockerfile:257-259. To run as a non-root user, you override the user at runtime using Docker's --user flag:
The entrypoint script automatically detects whether it's running as root or non-root and adjusts behavior accordingly entrypoint.sh:8-18:
su postgres -c to run PostgreSQL commands. When running as non-root, it runs initdb and postgres directly entrypoint.sh:102-111 entrypoint.sh:205-211.postgres role exists since the process won't be started under the postgres system user entrypoint.sh:224-228.The Dockerfile ensures all relevant directories are accessible to both root and the sourcebot user:
/app directory is owned by sourcebot and the root group has equivalent permissions Dockerfile:244-247/data directory is also owned by sourcebot Dockerfile:248-249--chown=sourcebot:sourcebot Dockerfile:221-234You can customize the UID and GID at build time using Docker build arguments:
This is defined via the ARG directives Dockerfile:185-186.
This chat is read-only.
