Files
docker-files/frp/Dockerfile
2026-01-22 15:51:28 +08:00

43 lines
1.2 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# FRP - Fast Reverse Proxy
# 可用于服务端 (frps) 或客户端 (frpc)
FROM debian:latest
LABEL maintainer="www.imyeyu.com"
LABEL description="FRP server and client image"
# frp 版本
ARG FRP_VERSION=0.66.0
# 代理地址 (可选)
ARG PROXY=""
# 安装必要依赖并下载 frp
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL ${PROXY:+-x "$PROXY"} \
"https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz" \
-o /tmp/frp.tar.gz \
&& tar -xzf /tmp/frp.tar.gz -C /tmp \
&& mv /tmp/frp_${FRP_VERSION}_linux_amd64/frps /usr/local/bin/ \
&& mv /tmp/frp_${FRP_VERSION}_linux_amd64/frpc /usr/local/bin/ \
&& chmod +x /usr/local/bin/frps /usr/local/bin/frpc \
&& rm -rf /tmp/*
# 创建配置目录
RUN mkdir -p /etc/frp
# 工作目录
WORKDIR /etc/frp
# 默认暴露端口
# 7000: frps 服务端口
# 7500: frps Dashboard
# 7400: frps KCPTUN
EXPOSE 7000 7500 7400
# 默认启动 frps可通过 CMD 覆盖为 frpc
ENTRYPOINT ["/usr/local/bin/frps"]
CMD ["-c", "/etc/frp/frps.toml"]