From 8be198ce5df9df74bd34772bf6d3ad78023e93d9 Mon Sep 17 00:00:00 2001 From: Philip Mantrov Date: Thu, 5 Dec 2024 13:16:47 +0300 Subject: [PATCH] fix: minimal fix for Dockerfile and force docker compose use local Dockerfile --- Dockerfile | 14 +++++++++----- docker-compose.yml | 4 +++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ac09b531..11ed668b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,8 @@ RUN apk --no-cache --update add \ build-base \ gcc \ wget \ - unzip + unzip \ + dos2unix COPY . . @@ -18,6 +19,9 @@ ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE" RUN go build -o build/x-ui main.go RUN ./DockerInit.sh "$TARGETARCH" +RUN dos2unix /app/DockerEntrypoint.sh +RUN dos2unix /app/x-ui.sh + # ======================================================== # Stage: Final Image of 3x-ui # ======================================================== @@ -29,12 +33,12 @@ RUN apk add --no-cache --update \ ca-certificates \ tzdata \ fail2ban \ - bash + bash \ + curl 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/local/x-ui/x-ui # Configure fail2ban RUN rm -f /etc/fail2ban/jail.d/alpine-ssh.conf \ @@ -46,7 +50,7 @@ RUN rm -f /etc/fail2ban/jail.d/alpine-ssh.conf \ RUN chmod +x \ /app/DockerEntrypoint.sh \ /app/x-ui \ - /usr/bin/x-ui + /usr/local/x-ui/x-ui VOLUME [ "/etc/x-ui" ] CMD [ "./x-ui" ] diff --git a/docker-compose.yml b/docker-compose.yml index b0a89399..ebf48924 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,9 @@ version: "3" services: 3x-ui: - image: ghcr.io/mhsanaei/3x-ui:latest + build: + context: . + dockerfile: ./Dockerfile container_name: 3x-ui hostname: yourhostname volumes: