diff --git a/Dockerfile b/Dockerfile index 3089bac..9c18554 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,23 @@ FROM alpine:latest WORKDIR /app -# 设置环境变量 +# 设置环境变量默认值 ENV UDP_PORT=20000 +# 安装依赖 & 创建必要目录 +RUN apk update && \ + apk add --no-cache curl wget openssl bash jq unzip ca-certificates && \ + mkdir -p /etc/hysteria + # 下载 hysteria2 主程序 RUN wget -q -O /usr/local/bin/hysteria https://download.hysteria.network/app/latest/hysteria-linux-amd64 && \ chmod +x /usr/local/bin/hysteria # 自签 TLS 证书 -RUN openssl ecparam -name prime256v1 -genkey -noout -out /etc/hysteria/server.key && \ - openssl req -x509 -new -nodes -key /etc/hysteria/server.key \ - -out /etc/hysteria/server.crt -subj "/CN=bing.com" -days 36500 +RUN openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) \ + -keyout /etc/hysteria/server.key \ + -out /etc/hysteria/server.crt \ + -subj "/CN=bing.com" -days 36500 # 拷贝 entrypoint 启动脚本 COPY entrypoint.sh /entrypoint.sh