36 lines
851 B
Docker
36 lines
851 B
Docker
FROM golang:1.24-alpine AS backend-builder
|
|
WORKDIR /app
|
|
ARG TARGETARCH
|
|
ENV CGO_ENABLED=1
|
|
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
|
|
ENV GOARCH=$TARGETARCH
|
|
|
|
RUN apk update && apk add --no-cache \
|
|
gcc \
|
|
musl-dev \
|
|
libc-dev \
|
|
make \
|
|
git \
|
|
wget \
|
|
unzip \
|
|
bash
|
|
|
|
ENV CC=gcc
|
|
|
|
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" \
|
|
-o sui main.go
|
|
|
|
FROM --platform=$TARGETPLATFORM alpine
|
|
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
|
|
ENV TZ=Asia/Tehran
|
|
WORKDIR /app
|
|
RUN apk add --no-cache --update ca-certificates tzdata
|
|
COPY --from=backend-builder /app/sui /app/
|
|
COPY entrypoint.sh /app/
|
|
VOLUME [ "s-ui" ]
|
|
ENTRYPOINT [ "./entrypoint.sh" ] |