File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,7 @@ ARG DEBIAN_FRONTEND=noninteractive
2020# the application crashes without emitting any logs due to buffering
2121ENV \
2222 PYTHONDONTWRITEBYTECODE=1 \
23- PYTHONUNBUFFERED=1 \
24- HOME=/home/sourcegraph
23+ PYTHONUNBUFFERED=1
2524
2625# Install packages
2726# default-jre needed for Atlassian's svn-migration-scripts.jar
@@ -86,5 +85,15 @@ COPY src/ src/
8685# The contents of this file changes every build
8786COPY build/.env build/.env
8887
88+ # Create the user, with a home directory
89+ RUN groupadd --gid 1002 sourcegraph && \
90+ useradd --uid 1001 --gid sourcegraph --create-home --home-dir /home/sourcegraph sourcegraph
91+
92+ # Give ownership of the whole /sg dir and all its contents to the new user
93+ RUN chown -R sourcegraph:sourcegraph /sg
94+
95+ # Switch to the new user
96+ USER sourcegraph
97+
8998# Start the container
9099CMD ["/usr/bin/python3" , "/sg/repo-converter/src/main.py" ]
You can’t perform that action at this time.
0 commit comments