diff --git a/tools/port-forward/Dockerfile b/tools/port-forward/Dockerfile new file mode 100644 index 0000000..7734714 --- /dev/null +++ b/tools/port-forward/Dockerfile @@ -0,0 +1,11 @@ +FROM alpine:3 + +RUN apk add --update --no-cache socat \ + && rm -rf /var/cache/apk/ + +RUN addgroup -g 1001 -S appgroup && \ + adduser -u 1001 -S appuser -G appgroup + +USER 1001 + +CMD ["sh", "-c", "socat tcp-listen:$LOCAL_PORT,reuseaddr,fork tcp:$REMOTE_HOST:$REMOTE_PORT & pid=$! && trap \"kill $pid\" SIGINT && echo \"Socat started listening on $LOCAL_PORT: Redirecting traffic to $REMOTE_HOST:$REMOTE_PORT ($pid)\" && wait $pid"]