-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gh-proxy
More file actions
32 lines (27 loc) · 1.38 KB
/
Copy pathDockerfile.gh-proxy
File metadata and controls
32 lines (27 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# gh-proxy service image (M8-GH-4B3): restricted chained CONNECT relay.
#
# Contract (R4/B3 §3):
# - stdlib-only application (no pip dependencies at all).
# - base pinned by the SAME digest as the gh-webhook image.
# - non-root UID/GID 9090 (mergepilot-gh, no login shell).
# - app files root-owned, read-only to the runtime user (in-image
# chmod guards against permissive build-context metadata).
# - no sudo/capabilities/host sockets/secrets baked in.
# - healthcheck: pure in-process config self-check — never touches
# the real upstream or GitHub.
FROM python:3.12-slim@sha256:9e869b0816f5537709825b49e62dc86d1c2691eff19b05c1d4dc3a07992cc052
RUN groupadd -g 9090 mergepilot-gh \
&& useradd -u 9090 -g 9090 -M -s /usr/sbin/nologin mergepilot-gh
COPY tools/gh-app/restricted_connect_proxy.py /app/gh_app/restricted_connect_proxy.py
# DrvFs build contexts can present 0777 source metadata; the contract
# (root-owned, runtime-user non-writable) is enforced IN the image.
RUN chmod 0644 /app/gh_app/restricted_connect_proxy.py \
&& chmod 0755 /app
WORKDIR /app/gh_app
ENV PYTHONUNBUFFERED=1 \
GH_PROXY_BIND=0.0.0.0 \
GH_PROXY_PORT=18090
HEALTHCHECK --interval=10s --timeout=5s --retries=6 \
CMD python -c "from restricted_connect_proxy import load_config; load_config(); print('config-ok')"
USER mergepilot-gh
ENTRYPOINT ["python", "-u", "restricted_connect_proxy.py"]