v1.4.0
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
FROM golang:1.25-alpine AS backend-builder
|
||||
WORKDIR /app
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
ENV CGO_ENABLED=1
|
||||
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
|
||||
ENV GOARCH=$TARGETARCH
|
||||
@@ -13,23 +14,30 @@ RUN apk update && apk add --no-cache \
|
||||
git \
|
||||
wget \
|
||||
unzip \
|
||||
bash
|
||||
bash \
|
||||
curl
|
||||
|
||||
ENV CC=gcc
|
||||
|
||||
RUN CRONET_ARCH="$TARGETARCH" && \
|
||||
CRONET_URL="https://github.com/SagerNet/cronet-go/releases/latest/download/libcronet-linux-${CRONET_ARCH}.so"; \
|
||||
echo "Downloading $CRONET_URL" && \
|
||||
wget -q -O ./libcronet.so "$CRONET_URL" && \
|
||||
chmod 755 ./libcronet.so
|
||||
|
||||
COPY . .
|
||||
# Copy pre-built frontend files from a known location (provided by workflow artifact)
|
||||
COPY frontend_dist/ /app/web/html/
|
||||
|
||||
RUN go build -ldflags="-w -s" \
|
||||
-tags "with_quic,with_grpc,with_utls,with_acme,with_gvisor,with_naive_outbound,with_musl" \
|
||||
RUN if [ "$TARGETARCH" = "arm" ]; then export GOARM=7; [ "$TARGETVARIANT" = "v6" ] && export GOARM=6; fi; \
|
||||
go build -ldflags="-w -s" \
|
||||
-tags "with_quic,with_grpc,with_utls,with_acme,with_gvisor,with_naive_outbound,with_purego" \
|
||||
-o sui main.go
|
||||
|
||||
FROM --platform=$TARGETPLATFORM alpine
|
||||
FROM alpine
|
||||
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
|
||||
ENV TZ=Asia/Tehran
|
||||
WORKDIR /app
|
||||
RUN set -ex && apk add --no-cache --upgrade bash tzdata ca-certificates nftables
|
||||
COPY --from=backend-builder /app/sui /app/
|
||||
COPY --from=backend-builder /app/sui /app/libcronet.so /app/
|
||||
COPY entrypoint.sh /app/
|
||||
ENTRYPOINT [ "./entrypoint.sh" ]
|
||||
Reference in New Issue
Block a user