rachkovii68 commited on
Commit
8585315
·
1 Parent(s): 08d4594

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 dos2unix wget curl tar bash ca-certificates --no-install-recommends && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
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.10.1
20
- RUN wget https://github.com/jpillora/chisel/releases/download/v${CHISEL_VERSION}/chisel_${CHISEL_VERSION}_linux_amd64.gz -O /tmp/chisel.gz && gunzip /tmp/chisel.gz && mv /tmp/chisel /usr/local/bin/chisel && chmod +x /usr/local/bin/chisel
21
-
22
- # Download and extract 3x-ui
23
- RUN ARCH=$(uname -m) && if [ "$ARCH" = "x86_64" ]; then ARCH="amd64"; fi && if [ "$ARCH" = "aarch64" ]; then ARCH="arm64"; fi && wget -O /usr/local/x-ui-linux-${ARCH}.tar.gz "https://github.com/MHSanaei/3x-ui/releases/latest/download/x-ui-linux-${ARCH}.tar.gz" && mkdir -p /usr/local/x-ui/ && tar -zxvf /usr/local/x-ui-linux-*.tar.gz -C /usr/local/x-ui/ --strip-components=1 && rm /usr/local/x-ui-linux-*.tar.gz && chmod +x /usr/local/x-ui/x-ui && cp /usr/local/x-ui/x-ui.sh /usr/bin/x-ui
24
-
25
- # Create directory for chisel certs and copy them
26
- RUN mkdir -p /etc/chisel
27
- COPY client.crt /etc/chisel/client.crt
28
- COPY client.key /etc/chisel/client.key
29
- COPY ca.crt /etc/chisel/ca.crt
30
-
31
- # Copy the startup script
 
 
 
 
 
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 /config
39
- RUN chmod 777 /config
 
40
 
41
- # Expose the x-ui port
42
  EXPOSE 2023
43
 
44
- # Set the entrypoint to our startup script
45
- RUN chmod -R 777 /usr/local/x-ui/
46
- ENTRYPOINT ["/bin/bash", "-c", "/usr/local/bin/start.sh"]
 
 
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"]