Quick docker refactoring

This commit is contained in:
Michael S2pac 2025-11-23 17:30:52 +03:00
parent e1058b1eaf
commit 1012636d35

View file

@ -5,7 +5,7 @@ FROM golang:1.25-alpine AS builder
WORKDIR /app WORKDIR /app
RUN apk --no-cache --update add \ RUN apk add --no-cache \
build-base \ build-base \
gcc gcc
@ -28,12 +28,12 @@ ARG TARGETARCH
ARG XRAY_VERSION ARG XRAY_VERSION
WORKDIR /app WORKDIR /app
RUN apk add --no-cache wget unzip RUN apk add --no-cache wget unzip && mkdir -p /app/bin
COPY xray-tools.sh . COPY xray-tools.sh .
RUN chmod +x /app/xray-tools.sh RUN chmod +x /app/xray-tools.sh && \
RUN ./xray-tools.sh install_xray_core "$TARGETARCH" "/app/bin" "$XRAY_VERSION" ./xray-tools.sh install_xray_core "$TARGETARCH" "/app/bin" "$XRAY_VERSION" && \
RUN ./xray-tools.sh update_geodata_in_docker "/app/bin" ./xray-tools.sh update_geodata_in_docker "/app/bin"
# ======================================================== # ========================================================
# Stage: Final Image of 3x-ui # Stage: Final Image of 3x-ui
@ -42,7 +42,7 @@ FROM alpine
WORKDIR /app WORKDIR /app
RUN apk add --no-cache --update \ RUN apk add --no-cache \
ca-certificates \ ca-certificates \
tzdata \ tzdata \
fail2ban \ fail2ban \
@ -50,7 +50,6 @@ RUN apk add --no-cache --update \
COPY DockerEntrypoint.sh /app/ COPY DockerEntrypoint.sh /app/
COPY --from=builder /app/build/ /app/ COPY --from=builder /app/build/ /app/
#COPY --from=builder /app/DockerEntrypoint.sh /app/
COPY --from=builder /app/x-ui.sh /usr/bin/x-ui COPY --from=builder /app/x-ui.sh /usr/bin/x-ui
COPY --from=xray-downloader /app/bin /app/bin COPY --from=xray-downloader /app/bin /app/bin
@ -70,5 +69,5 @@ RUN chmod +x \
ENV XUI_ENABLE_FAIL2BAN="true" ENV XUI_ENABLE_FAIL2BAN="true"
EXPOSE 2053 EXPOSE 2053
VOLUME [ "/etc/x-ui" ] VOLUME [ "/etc/x-ui" ]
#CMD [ "./x-ui" ]
ENTRYPOINT [ "/app/DockerEntrypoint.sh" ] ENTRYPOINT [ "/app/DockerEntrypoint.sh" ]