Spaces:
Paused
Paused
Commit ·
8585315
1
Parent(s): 08d4594
Update Dockerfile
Browse files- Dockerfile +35 -24
Dockerfile
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
|
|
| 1 |
FROM debian:bullseye-slim
|
| 2 |
|
| 3 |
# Install necessary packages and clean up
|
| 4 |
-
RUN apt-get update && apt-get install -y
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Install wgcf
|
| 7 |
RUN wget -O /usr/local/bin/wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.29/wgcf_2.2.29_linux_amd64 && \
|
|
@@ -13,34 +21,37 @@ RUN wget -O /tmp/wireproxy.tar.gz https://github.com/whyvl/wireproxy/releases/do
|
|
| 13 |
chmod +x /usr/local/bin/wireproxy && \
|
| 14 |
rm /tmp/wireproxy.tar.gz
|
| 15 |
|
| 16 |
-
SHELL ["/bin/bash", "-c"]
|
| 17 |
-
|
| 18 |
# Install chisel
|
| 19 |
-
ARG CHISEL_VERSION=1.
|
| 20 |
-
RUN wget https://github.com/jpillora/chisel/releases/download/v${CHISEL_VERSION}/chisel_${CHISEL_VERSION}_linux_amd64.gz -O /tmp/chisel.gz &&
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
#
|
| 26 |
-
RUN
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
COPY start.sh /usr/local/bin/start.sh
|
| 33 |
RUN dos2unix /usr/local/bin/start.sh
|
| 34 |
-
|
| 35 |
-
# Make the script executable
|
| 36 |
RUN chmod +x /usr/local/bin/start.sh
|
| 37 |
|
| 38 |
-
RUN mkdir /
|
| 39 |
-
|
|
|
|
| 40 |
|
| 41 |
-
# Expose the x-ui port
|
| 42 |
EXPOSE 2023
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
| 1 |
+
# Use a lightweight base image
|
| 2 |
FROM debian:bullseye-slim
|
| 3 |
|
| 4 |
# Install necessary packages and clean up
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
dos2unix \
|
| 7 |
+
wget \
|
| 8 |
+
curl \
|
| 9 |
+
tar \
|
| 10 |
+
ca-certificates \
|
| 11 |
+
--no-install-recommends && \
|
| 12 |
+
rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
# Install wgcf
|
| 15 |
RUN wget -O /usr/local/bin/wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.29/wgcf_2.2.29_linux_amd64 && \
|
|
|
|
| 21 |
chmod +x /usr/local/bin/wireproxy && \
|
| 22 |
rm /tmp/wireproxy.tar.gz
|
| 23 |
|
|
|
|
|
|
|
| 24 |
# Install chisel
|
| 25 |
+
ARG CHISEL_VERSION=1.9.1
|
| 26 |
+
RUN wget https://github.com/jpillora/chisel/releases/download/v${CHISEL_VERSION}/chisel_${CHISEL_VERSION}_linux_amd64.gz -O /tmp/chisel.gz && \
|
| 27 |
+
gunzip /tmp/chisel.gz && \
|
| 28 |
+
mv /tmp/chisel /usr/local/bin/chisel && \
|
| 29 |
+
chmod +x /usr/local/bin/chisel
|
| 30 |
+
|
| 31 |
+
# Download and install x-ui
|
| 32 |
+
RUN LATEST_XUI_URL=$(curl -sL "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest" | grep '"browser_download_url":' | grep 'linux-amd64.tar.gz' | sed -E 's/.*"([^"]+)".*/\1/') && \
|
| 33 |
+
wget -O /tmp/x-ui.tar.gz "${LATEST_XUI_URL}" && \
|
| 34 |
+
mkdir -p /opt/x-ui && \
|
| 35 |
+
tar -zxvf /tmp/x-ui.tar.gz -C /opt/x-ui && \
|
| 36 |
+
rm /tmp/x-ui.tar.gz && \
|
| 37 |
+
chmod +x /opt/x-ui/x-ui/x-ui
|
| 38 |
+
|
| 39 |
+
# Force rebuild by adding a changing ARG
|
| 40 |
+
ARG CACHE_BUSTER=20250903050820
|
| 41 |
+
|
| 42 |
+
# Copy the startup script and fix line endings
|
| 43 |
COPY start.sh /usr/local/bin/start.sh
|
| 44 |
RUN dos2unix /usr/local/bin/start.sh
|
|
|
|
|
|
|
| 45 |
RUN chmod +x /usr/local/bin/start.sh
|
| 46 |
|
| 47 |
+
RUN mkdir -p /data /var/log && chmod 777 /data /var/log
|
| 48 |
+
|
| 49 |
+
RUN mkdir -p /config && touch /config/cron.log && chmod 777 /config /config/cron.log
|
| 50 |
|
| 51 |
+
# Expose the x-ui port (default is 2053, can be changed in config)
|
| 52 |
EXPOSE 2023
|
| 53 |
|
| 54 |
+
WORKDIR /usr/local/x-ui
|
| 55 |
+
|
| 56 |
+
# Set the entrypoint to execute with bash
|
| 57 |
+
ENTRYPOINT ["/bin/bash", "/usr/local/bin/start.sh"]
|