Skip to content

Commit 0136d9f

Browse files
committed
fix: port conflict
1 parent 933c6d8 commit 0136d9f

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ENV LANG="C.UTF-8" \
99
UMASK=000 \
1010
MOVIEPILOT_AUTO_UPDATE=true \
1111
MOVIEPILOT_AUTO_UPDATE_DEV=false \
12+
PORT=3001 \
1213
NGINX_PORT=3000 \
1314
CONFIG_DIR="/config" \
1415
API_TOKEN="moviepilot" \

app/utils/system.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def restart() -> Tuple[bool, str]:
309309
"""
310310
try:
311311
# 创建 Docker 客户端
312-
client = docker.DockerClient(base_url='tcp://127.0.0.1:2375')
312+
client = docker.DockerClient(base_url='tcp://127.0.0.1:38379')
313313
# 获取当前容器的 ID
314314
container_id = open("/proc/self/cgroup", "r").read().split("/")[-1]
315315
if not container_id:

entrypoint

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# 使用 `envsubst` 将模板文件中的 ${NGINX_PORT} 替换为实际的环境变量值
4-
envsubst '${NGINX_PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf
4+
envsubst '${NGINX_PORT}${PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf
55
# 自动更新
66
if [ "${MOVIEPILOT_AUTO_UPDATE}" = "true" ]; then
77
cd /

haproxy.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ backend dockerbackend
5050
server dockersocket /var/run/docker.sock
5151

5252
frontend dockerfrontend
53-
bind :2375
53+
bind :38379
5454
http-request deny unless METH_GET || { env(POST) -m bool }
5555
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/((stop)|(restart)|(kill)) } { env(ALLOW_RESTARTS) -m bool }
5656
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers } { env(CONTAINERS) -m bool }

nginx.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ http {
100100

101101
upstream backend_api {
102102
# 后端API的地址和端口
103-
server 127.0.0.1:3001;
103+
server 127.0.0.1:${PORT};
104104
# 可以添加更多后端服务器作为负载均衡
105105
}
106106

0 commit comments

Comments
 (0)