Skip to content

Commit 0c9f5c6

Browse files
authored
Merge pull request #88 from Dstack-TEE/vk/d9b5-dstack-ingress-2
dstack-ingress 2.0: nginx → haproxy L4 TCP proxy
2 parents 9150c20 + 8ed590f commit 0c9f5c6

11 files changed

Lines changed: 841 additions & 424 deletions

File tree

custom-domain/dstack-ingress/Dockerfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
FROM nginx@sha256:b6653fca400812e81569f9be762ae315db685bc30b12ddcdc8616c63a227d3ca
1+
FROM haproxy@sha256:49a0a0d6f0b8b7e59c233b06eefab1564f2c8d64f673554d368fd7d2ab4b2c2d
2+
3+
# haproxy image runs as non-root (uid 99) by default; we need root for
4+
# certbot, DNS management, and writing to /etc/haproxy/certs.
5+
USER root
26

37
RUN --mount=type=bind,source=pinned-packages.txt,target=/tmp/pinned-packages.txt,ro \
48
set -e; \
@@ -26,15 +30,17 @@ RUN --mount=type=bind,source=pinned-packages.txt,target=/tmp/pinned-packages.txt
2630
python3.11-venv \
2731
curl \
2832
jq \
29-
coreutils && \
33+
coreutils \
34+
mini-httpd && \
3035
rm -rf /var/lib/apt/lists/* /var/log/* /var/cache/ldconfig/aux-cache
3136

3237
RUN mkdir -p \
3338
/etc/letsencrypt \
3439
/var/www/certbot \
35-
/usr/share/nginx/html \
36-
/etc/nginx/conf.d \
37-
/var/log/nginx
40+
/etc/haproxy/certs \
41+
/var/run/haproxy \
42+
/var/lib/haproxy \
43+
/evidences
3844

3945
# Install scripts with deterministic permissions via bind mount
4046
RUN --mount=type=bind,source=scripts,target=/tmp/scripts,ro \
@@ -62,4 +68,4 @@ ENV PYTHONUNBUFFERED=1
6268
COPY --chmod=666 .GIT_REV /etc/
6369

6470
ENTRYPOINT ["/scripts/entrypoint.sh"]
65-
CMD ["nginx", "-g", "daemon off;"]
71+
CMD ["haproxy", "-W", "-f", "/etc/haproxy/haproxy.cfg"]

0 commit comments

Comments
 (0)