Merge pull request #518 from DDS-Derek/main

fix: port conflict
This commit is contained in:
jxxghp 2023-09-09 10:45:54 +08:00 committed by GitHub
commit 4373c0596b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 4 deletions

View File

@ -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" \

View File

@ -309,7 +309,7 @@ class SystemUtils:
"""
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:

View File

@ -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 /

View File

@ -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 }

View File

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