diff --git a/DockerEntrypoint.sh b/DockerEntrypoint.sh index 9ebcd1d6..4da1c2e7 100644 --- a/DockerEntrypoint.sh +++ b/DockerEntrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh # Start fail2ban fail2ban-client -x start diff --git a/DockerInit.sh b/DockerInit.sh index e64075b2..39a5bf8b 100755 --- a/DockerInit.sh +++ b/DockerInit.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh case $1 in amd64) ARCH="64" diff --git a/Dockerfile b/Dockerfile index ac09b531..5e10caae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ # ======================================================== # Stage: Builder # ======================================================== -FROM golang:1.23-alpine AS builder +FROM golang:1.23-bookworm AS builder WORKDIR /app ARG TARGETARCH -RUN apk --no-cache --update add \ - build-base \ - gcc \ - wget \ - unzip +RUN apt-get update -y +RUN apt-get install -y \ + gcc \ + wget \ + unzip COPY . . @@ -21,12 +21,12 @@ RUN ./DockerInit.sh "$TARGETARCH" # ======================================================== # Stage: Final Image of 3x-ui # ======================================================== -FROM alpine +FROM ubuntu:rolling ENV TZ=Asia/Tehran WORKDIR /app -RUN apk add --no-cache --update \ - ca-certificates \ +RUN apt-get update -y +RUN apt-get install -y \ tzdata \ fail2ban \ bash @@ -37,7 +37,7 @@ COPY --from=builder /app/x-ui.sh /usr/bin/x-ui # Configure fail2ban -RUN rm -f /etc/fail2ban/jail.d/alpine-ssh.conf \ +RUN rm -f /etc/fail2ban/jail.d/*.conf \ && cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local \ && sed -i "s/^\[ssh\]$/&\nenabled = false/" /etc/fail2ban/jail.local \ && sed -i "s/^\[sshd\]$/&\nenabled = false/" /etc/fail2ban/jail.local \ diff --git a/install.sh b/install.sh index c6c52000..a75ff8ee 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash red='\033[0;31m' green='\033[0;32m' diff --git a/x-ui.sh b/x-ui.sh index 4b2e8a20..e07753da 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash red='\033[0;31m' green='\033[0;32m'