Skip to content

Commit 0c279b1

Browse files
committed
(socks-proxy) add healthcheck to dockerfile
1 parent 36d9352 commit 0c279b1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/socks-proxy/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ARG DANTE_SHA256=1973c7732f1f9f0a4c0ccf2c1ce462c7c25060b25643ea90f9b98f53a813fae
66

77
RUN <<EOR
88
apt-get update
9-
apt-get install -y build-essential curl
9+
DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential curl
1010
EOR
1111

1212
RUN <<EOR
@@ -23,8 +23,9 @@ EOR
2323
FROM debian:trixie-slim AS runtime
2424

2525
COPY --from=base /usr/local/sbin/sockd /usr/local/sbin/sockd
26-
2726
COPY --chmod=0755 entrypoint.sh /entrypoint.sh
2827

2928
ENTRYPOINT ["/entrypoint.sh"]
29+
HEALTHCHECK --interval=30s --timeout=3s --start-interval=5s \
30+
CMD cat /proc/$(cat /var/run/sockd.pid)/status | grep State | grep -E 'R \(running\)|S \(sleeping\)'
3031
CMD ["/usr/local/sbin/sockd"]

src/socks-proxy/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
3+
umask 0077
34

45
if [ -z "${PROXY_USERS:-}" ]; then
56
echo "Error: PROXY_USERS env var is not set (format: user1:pass1,user2:pass2)"
@@ -59,6 +60,5 @@ done
5960

6061
# Replace the placeholder with the generated configuration
6162
echo "$DANTE_CONFIG" > /etc/sockd.conf
62-
chmod 0600 /etc/sockd.conf
6363

6464
exec "$@"

0 commit comments

Comments
 (0)