Skip to content

Commit 6835ae2

Browse files
Merge pull request #71 from graphprotocol/muhammad/fix-dockerfile-permissions
fix dockerfile and add non-root user
2 parents 8339a26 + 95dcdaa commit 6835ae2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ COPY pyproject.toml ./
5151
# Create healthcheck file
5252
RUN touch /app/healthcheck
5353

54+
# Create non-root user with UID 1000 for improved security
55+
# This ensures the application can write to /app/healthcheck at runtime
56+
RUN groupadd -f -g 1000 oracle && \
57+
useradd -u 1000 -g oracle -s /bin/bash -m oracle
58+
59+
# Change ownership of all /app files to the oracle user
60+
RUN chown -R oracle:oracle /app
61+
62+
# Switch to non-root user for runtime security
63+
USER oracle
64+
5465
# Use Tini as entrypoint for proper signal handling
5566
ENTRYPOINT ["/usr/bin/tini", "--"]
5667

0 commit comments

Comments
 (0)