Properly use multi-stage build

This commit is contained in:
unidcml
2025-02-03 00:58:28 +03:00
parent 7d859ba521
commit 08bfc1cc06
2 changed files with 13 additions and 24 deletions

View File

@@ -1,25 +1,21 @@
FROM ghcr.io/sagernet/sing-box:v1.10.7 AS sing-box
FROM golang:1.23.1-alpine3.20 AS golang
FROM golang:1.23.5-alpine3.21 AS go-builder
WORKDIR /app
COPY xray-geosite/. /app
RUN go build -o geosite-compiler
FROM python:3.10.16-alpine3.21
COPY --from=sing-box /usr/local/bin/sing-box /bin/sing-box
COPY --from=golang /usr/local/go /usr/local/go
ENV GOROOT=/usr/local/go
ENV PATH="/usr/local/go/bin:${PATH}"
COPY --from=go-builder /app/geosite-compiler /bin/geosite-compiler
RUN pip install --no-cache-dir tldextract
COPY xray-geosite /app/xray-geosite
WORKDIR /app/xray-geosite
RUN go mod download
WORKDIR /app
COPY convert.py /app/convert.py