wolfyang / Dockerfile
yangwfb
1
358a9df
Raw
History Blame Contribute Delete
1.23 kB
# 使用 alpine:latest 作为基础镜像
FROM alpine:latest
# 更换国内源并安装 nginx 和必要的工具 (如 bash/curl 用于调试,非必须)
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk update && \
apk add --no-cache nginx curl bash
# 1. 配置 Nginx
COPY nginx.conf /etc/nginx/nginx.conf
RUN mkdir -p /var/www/html
COPY index.html /var/www/html/index.html
RUN mkdir -p /app
WORKDIR /app
# 2. 添加 EasyTier 二进制文件
# 从 GitHub 下载 EasyTier 并解压
RUN wget https://github.com/EasyTier/EasyTier/releases/download/v2.6.0/easytier-linux-x86_64-v2.6.0.zip && \
unzip easytier-linux-x86_64-v2.6.0.zip && \
rm easytier-linux-x86_64-v2.6.0.zip && \
# 将子目录中的所有文件移动到当前目录
mv easytier-linux-x86_64/easytier-core /app/ && \
rm -rf easytier-linux-x86_64 && \
# 给所有可执行文件添加执行权限
chmod +x /app/easytier-core
# 3. 创建启动脚本
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# 暴露 Nginx 端口 (根据你的映射需求)
EXPOSE 7860
RUN pwd
# 容器启动时执行脚本
ENTRYPOINT ["/app/entrypoint.sh"]