forked from zzzhhh1/Sing-Flare-Auto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 1.27 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (27 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM alpine:latest
# 设置版本变量,方便以后维护
# sing-box 版本: https://github.com/SagerNet/sing-box/releases
# cloudflared 版本: https://github.com/cloudflare/cloudflared/releases
ARG SING_BOX_VERSION=1.10.1
ARG CLOUDFLARED_VERSION=latest
# 安装必要的下载工具和基础库
RUN apk add --no-cache ca-certificates bash wget tar
WORKDIR /app
# 1. 下载并安装 sing-box (对应你的 web-app)
# 根据 Alpine 架构下载对应的 amd64 版本
RUN wget https://github.com/SagerNet/sing-box/releases/download/v${SING_BOX_VERSION}/sing-box-${SING_BOX_VERSION}-linux-amd64.tar.gz && \
tar -zxvf sing-box-${SING_BOX_VERSION}-linux-amd64.tar.gz && \
mv sing-box-${SING_BOX_VERSION}-linux-amd64/sing-box /usr/local/bin/sing-box && \
rm -rf sing-box-${SING_BOX_VERSION}-linux-amd64*
# 2. 下载并安装 cloudflared (对应你的 sys-service)
RUN wget -O /usr/local/bin/cloudflared https://github.com/cloudflare/cloudflared/releases/${CLOUDFLARED_VERSION}/download/cloudflared-linux-amd64
# 3. 复制你仓库里现有的配置文件 (config.json, start.sh 等)
COPY . .
# 4. 赋予执行权限
RUN chmod +x /usr/local/bin/sing-box && \
chmod +x /usr/local/bin/cloudflared && \
chmod +x start.sh
# 声明端口
EXPOSE 8080
# 启动脚本
CMD ["./start.sh"]