mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-11 12:46:19 +00:00
fix: minimal fix for Dockerfile and force docker compose use local Dockerfile
This commit is contained in:
parent
4efcdb3e01
commit
8be198ce5d
2 changed files with 12 additions and 6 deletions
14
Dockerfile
14
Dockerfile
|
@ -9,7 +9,8 @@ RUN apk --no-cache --update add \
|
||||||
build-base \
|
build-base \
|
||||||
gcc \
|
gcc \
|
||||||
wget \
|
wget \
|
||||||
unzip
|
unzip \
|
||||||
|
dos2unix
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
@ -18,6 +19,9 @@ ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
|
||||||
RUN go build -o build/x-ui main.go
|
RUN go build -o build/x-ui main.go
|
||||||
RUN ./DockerInit.sh "$TARGETARCH"
|
RUN ./DockerInit.sh "$TARGETARCH"
|
||||||
|
|
||||||
|
RUN dos2unix /app/DockerEntrypoint.sh
|
||||||
|
RUN dos2unix /app/x-ui.sh
|
||||||
|
|
||||||
# ========================================================
|
# ========================================================
|
||||||
# Stage: Final Image of 3x-ui
|
# Stage: Final Image of 3x-ui
|
||||||
# ========================================================
|
# ========================================================
|
||||||
|
@ -29,12 +33,12 @@ RUN apk add --no-cache --update \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
tzdata \
|
tzdata \
|
||||||
fail2ban \
|
fail2ban \
|
||||||
bash
|
bash \
|
||||||
|
curl
|
||||||
|
|
||||||
COPY --from=builder /app/build/ /app/
|
COPY --from=builder /app/build/ /app/
|
||||||
COPY --from=builder /app/DockerEntrypoint.sh /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
|
# Configure fail2ban
|
||||||
RUN rm -f /etc/fail2ban/jail.d/alpine-ssh.conf \
|
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 \
|
RUN chmod +x \
|
||||||
/app/DockerEntrypoint.sh \
|
/app/DockerEntrypoint.sh \
|
||||||
/app/x-ui \
|
/app/x-ui \
|
||||||
/usr/bin/x-ui
|
/usr/local/x-ui/x-ui
|
||||||
|
|
||||||
VOLUME [ "/etc/x-ui" ]
|
VOLUME [ "/etc/x-ui" ]
|
||||||
CMD [ "./x-ui" ]
|
CMD [ "./x-ui" ]
|
||||||
|
|
|
@ -3,7 +3,9 @@ version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
3x-ui:
|
3x-ui:
|
||||||
image: ghcr.io/mhsanaei/3x-ui:latest
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
container_name: 3x-ui
|
container_name: 3x-ui
|
||||||
hostname: yourhostname
|
hostname: yourhostname
|
||||||
volumes:
|
volumes:
|
||||||
|
|
Loading…
Reference in a new issue