Skip to content

Commit 8e8f87f

Browse files
committed
Just about done with your shit, podman
1 parent ada93ab commit 8e8f87f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

build/Dockerfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ ARG DEBIAN_FRONTEND=noninteractive
2020
# the application crashes without emitting any logs due to buffering
2121
ENV \
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
8786
COPY 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
9099
CMD ["/usr/bin/python3", "/sg/repo-converter/src/main.py"]

0 commit comments

Comments
 (0)