Skip to content

Commit

Permalink
fix: port conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Sep 9, 2023
1 parent 933c6d8 commit 0136d9f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ENV LANG="C.UTF-8" \
UMASK=000 \
MOVIEPILOT_AUTO_UPDATE=true \
MOVIEPILOT_AUTO_UPDATE_DEV=false \
PORT=3001 \
NGINX_PORT=3000 \
CONFIG_DIR="/config" \
API_TOKEN="moviepilot" \
Expand Down
2 changes: 1 addition & 1 deletion app/utils/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def restart() -> Tuple[bool, str]:
"""
try:
# 创建 Docker 客户端
client = docker.DockerClient(base_url='tcp://127.0.0.1:2375')
client = docker.DockerClient(base_url='tcp://127.0.0.1:38379')
# 获取当前容器的 ID
container_id = open("/proc/self/cgroup", "r").read().split("/")[-1]
if not container_id:
Expand Down
2 changes: 1 addition & 1 deletion entrypoint
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# 使用 `envsubst` 将模板文件中的 ${NGINX_PORT} 替换为实际的环境变量值
envsubst '${NGINX_PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf
envsubst '${NGINX_PORT}${PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf
# 自动更新
if [ "${MOVIEPILOT_AUTO_UPDATE}" = "true" ]; then
cd /
Expand Down
2 changes: 1 addition & 1 deletion haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ backend dockerbackend
server dockersocket /var/run/docker.sock

frontend dockerfrontend
bind :2375
bind :38379
http-request deny unless METH_GET || { env(POST) -m bool }
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 }
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers } { env(CONTAINERS) -m bool }
Expand Down
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ http {

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

Expand Down

0 comments on commit 0136d9f

Please sign in to comment.