dark3proxy: migrate to plain 3proxy runtime

This commit is contained in:
auto-ci
2026-03-09 13:55:48 -04:00
parent 2bccb692a2
commit 58dcb6d9a6
6 changed files with 213 additions and 56 deletions
+43 -39
View File
@@ -1,25 +1,15 @@
# Stage 1: Build
FROM --platform=$TARGETPLATFORM ubuntu:22.04 AS builder
ARG BUILDPLATFORM
ARG TARGETPLATFORM
ARG TARGETARCH
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y \
qtbase5-dev \
qtchooser \
qt5-qmake \
qtbase5-dev-tools \
wget \
git \
build-essential \
libqt5core5a \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Download and extract appropriate 3proxy package based on architecture
# Download and extract appropriate 3proxy package based on architecture.
RUN set -eux; \
if [ "$TARGETARCH" = "amd64" ]; then \
pkg_url="https://github.com/3proxy/3proxy/releases/download/0.9.4/3proxy-0.9.4.x86_64.deb"; \
@@ -37,45 +27,59 @@ RUN set -eux; \
mkdir -p /usr/local/3proxy; \
cp -a /tmp/3proxy-root/usr/local/3proxy/. /usr/local/3proxy/ || true
# Build 3proxy-eagle in a dedicated source directory
RUN git clone https://gitea.darkness.services/acetone/3proxy-eagle.git /src/3proxy-eagle \
&& cd /src/3proxy-eagle \
&& find . -name "*.cpp" -o -name "*.h" | xargs sed -i 's/127\.0\.0\.1/0.0.0.0/g' \
&& cd /src/3proxy-eagle/src \
&& qmake 3proxy-eagle.pro \
&& make -j$(nproc)
# Stage 1b: Build Yggdrasil tooling for target arch
FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS builder_yggdrasil
ARG TARGETARCH
ARG YGGDRASIL_VERSION=v0.5.12
RUN git clone https://github.com/yggdrasil-network/yggdrasil-go.git /src/yggdrasil-go \
&& cd /src/yggdrasil-go \
&& git checkout ${YGGDRASIL_VERSION}
RUN set -eux; \
case "${TARGETARCH}" in \
amd64) goarch=amd64 ;; \
arm64) goarch=arm64 ;; \
arm) goarch=arm ;; \
*) echo "Unsupported architecture: ${TARGETARCH}"; exit 1 ;; \
esac; \
cd /src/yggdrasil-go; \
mkdir -p /out; \
CGO_ENABLED=0 GOOS=linux GOARCH=${goarch} go build -o /out/yggdrasil ./cmd/yggdrasil; \
CGO_ENABLED=0 GOOS=linux GOARCH=${goarch} go build -o /out/yggdrasilctl ./cmd/yggdrasilctl; \
CGO_ENABLED=0 GOOS=linux GOARCH=${goarch} go build -o /out/genkeys ./cmd/genkeys
# Stage 2: Runtime
FROM ubuntu:22.04
ARG TARGETARCH
RUN apt-get update && apt-get install -y \
libqt5core5a \
libqt5network5 \
libqt5xml5 \
libqt5sql5 \
libqt5sql5-sqlite \
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
iproute2 \
iputils-ping \
&& rm -rf /var/lib/apt/lists/*
# Copy binaries using the correct absolute paths from Stage 1
COPY --from=builder /usr/local/bin/3proxy /usr/bin/3proxy
COPY --from=builder /src/3proxy-eagle/src/3proxy-eagle /usr/bin/3proxy-eagle
COPY --from=builder /usr/local/3proxy /usr/local/3proxy
COPY --from=builder_yggdrasil /out/yggdrasil /usr/bin/yggdrasil
COPY --from=builder_yggdrasil /out/yggdrasilctl /usr/bin/yggdrasilctl
COPY --from=builder_yggdrasil /out/genkeys /usr/bin/genkeys
# Copy local runtime helpers/config
COPY ./entrypoint.sh /entrypoint.sh
COPY ./yggdrasil.conf /etc/yggdrasil/yggdrasil.conf
# Setup config directories
RUN mkdir -p /etc/3proxy /etc/3proxy-eagle/data
RUN mkdir -p /etc/3proxy /etc/yggdrasil \
&& chmod +x /entrypoint.sh
# Ensure these files exist in your local directory where you run 'docker build'
#COPY first-instanse.cfg /etc/3proxy/
#COPY second-instanse.cfg /etc/3proxy/
EXPOSE 8161
EXPOSE 1080 3128 8161
# Run in foreground
CMD ["/usr/bin/3proxy-eagle", \
"-i", "/usr/bin/3proxy,/etc/3proxy/first-instanse.cfg", \
"-i", "/usr/bin/3proxy,/etc/3proxy/second-instanse.cfg", \
"-w", "/etc/3proxy-eagle/data", \
"-t", "DarkProxy"]
# Start Yggdrasil first, then run plain 3proxy instances from entrypoint.
ENTRYPOINT ["/entrypoint.sh"]
CMD []