Create Dockerfile
Browse files- Dockerfile +15 -0
Dockerfile
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ghcr.io/fish2018/pansou-web:latest
|
| 2 |
+
|
| 3 |
+
# 1. 安装 socat
|
| 4 |
+
RUN apk add --no-cache socat
|
| 5 |
+
|
| 6 |
+
# 2. 创建自定义启动脚本
|
| 7 |
+
# 这个脚本会先在后台启动端口转发,然后通过 exec 启动原始的应用脚本
|
| 8 |
+
RUN echo '#!/bin/sh' > /custom_start.sh && \
|
| 9 |
+
echo 'echo "Starting socat proxy on port 7860..."' >> /custom_start.sh && \
|
| 10 |
+
echo 'socat TCP-LISTEN:7860,fork,reuseaddr TCP:127.0.0.1:80 &' >> /custom_start.sh && \
|
| 11 |
+
echo 'echo "Starting original application..."' >> /custom_start.sh && \
|
| 12 |
+
echo 'exec /app/start.sh' >> /custom_start.sh && \
|
| 13 |
+
chmod +x /custom_start.sh
|
| 14 |
+
|
| 15 |
+
CMD ["/custom_start.sh"]
|