FROM ghcr.io/fish2018/pansou-web:latest # 1. 安装 socat RUN apk add --no-cache socat # 2. 创建自定义启动脚本 # 这个脚本会先在后台启动端口转发,然后通过 exec 启动原始的应用脚本 RUN echo '#!/bin/sh' > /custom_start.sh && \ echo 'echo "Starting socat proxy on port 7860..."' >> /custom_start.sh && \ echo 'socat TCP-LISTEN:7860,fork,reuseaddr TCP:127.0.0.1:80 &' >> /custom_start.sh && \ echo 'echo "Starting original application..."' >> /custom_start.sh && \ echo 'exec /app/start.sh' >> /custom_start.sh && \ chmod +x /custom_start.sh CMD ["/custom_start.sh"]