This commit is contained in:
2025-12-24 00:32:59 +03:00
parent 2d61830d08
commit 2a107b64e6
2 changed files with 20 additions and 9 deletions

View File

@@ -1,19 +1,29 @@
FROM alpine:3.20
ARG SINGBOX_VER=1.8.10
ARG VLESS_URL
RUN apk add --no-cache curl ca-certificates tar jq bash coreutils netcat-openbsd python3 && update-ca-certificates \
&& curl -L -o /tmp/sb.tar.gz https://github.com/SagerNet/sing-box/releases/download/v${SINGBOX_VER}/sing-box-${SINGBOX_VER}-linux-amd64.tar.gz \
# Устанавливаем зависимости, включая dos2unix для исправления скриптов
RUN apk add --no-cache curl ca-certificates tar jq bash coreutils netcat-openbsd python3 dos2unix && update-ca-certificates
# Автоматическое определение архитектуры и установка sing-box
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then SB_ARCH="amd64"; \
elif [ "$ARCH" = "aarch64" ]; then SB_ARCH="arm64"; \
else SB_ARCH="amd64"; fi && \
curl -L -o /tmp/sb.tar.gz https://github.com/SagerNet/sing-box/releases/download/v${SINGBOX_VER}/sing-box-${SINGBOX_VER}-linux-${SB_ARCH}.tar.gz \
&& tar -xf /tmp/sb.tar.gz -C /tmp \
&& mv /tmp/sing-box-${SINGBOX_VER}-linux-amd64/sing-box /usr/local/bin/sing-box \
&& mv /tmp/sing-box-${SINGBOX_VER}-linux-${SB_ARCH}/sing-box /usr/local/bin/sing-box \
&& chmod +x /usr/local/bin/sing-box \
&& adduser -D -u 1000 suser
COPY --chown=suser:suser config/client.template.json /app/
COPY --chown=suser:suser scripts/gen-client-from-url.sh scripts/menu.sh /app/
COPY --chown=suser:suser docker/entrypoint.sh /app/
COPY --chown=suser:suser web/ /app/web/
RUN chmod +x /app/gen-client-from-url.sh /app/entrypoint.sh /app/menu.sh
# Исправляем окончания строк (важно для Windows пользователей) и даем права на запуск
RUN dos2unix /app/*.sh && chmod +x /app/gen-client-from-url.sh /app/entrypoint.sh /app/menu.sh
ENV VLESS_URL=$VLESS_URL
EXPOSE 8082 9090 3456
ENTRYPOINT ["/app/entrypoint.sh"]