fix: 重启更新
This commit is contained in:
parent
55dce26cb8
commit
c8bc6a4618
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@ -14,13 +14,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: ${{ secrets.DOCKER_USERNAME }}/moviepilot
|
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Release version
|
name: Release version
|
||||||
@ -29,6 +23,16 @@ jobs:
|
|||||||
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
|
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
|
||||||
echo "app_version=$app_version" >> $GITHUB_ENV
|
echo "app_version=$app_version" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
-
|
||||||
|
name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: ${{ secrets.DOCKER_USERNAME }}/moviepilot
|
||||||
|
tags: |
|
||||||
|
type=raw,value=${{ env.app_version }}
|
||||||
|
type=raw,value=latest
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Set Up QEMU
|
name: Set Up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
@ -55,7 +59,5 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
build-args: |
|
build-args: |
|
||||||
MOVIEPILOT_VERSION=${{ env.app_version }}
|
MOVIEPILOT_VERSION=${{ env.app_version }}
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
${{ secrets.DOCKER_USERNAME }}/moviepilot:latest
|
|
||||||
${{ secrets.DOCKER_USERNAME }}/moviepilot:${{ env.app_version }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Release Version
|
name: Release Version
|
||||||
|
@ -59,7 +59,7 @@ RUN apt-get update \
|
|||||||
&& cp -f /app/update /usr/local/bin/mp_update \
|
&& cp -f /app/update /usr/local/bin/mp_update \
|
||||||
&& cp -f /app/entrypoint /entrypoint \
|
&& cp -f /app/entrypoint /entrypoint \
|
||||||
&& chmod +x /entrypoint /usr/local/bin/mp_update \
|
&& chmod +x /entrypoint /usr/local/bin/mp_update \
|
||||||
&& mkdir -p ${HOME} \
|
&& mkdir -p ${HOME} /var/lib/haproxy/server-state \
|
||||||
&& groupadd -r moviepilot -g 911 \
|
&& groupadd -r moviepilot -g 911 \
|
||||||
&& useradd -r moviepilot -g moviepilot -d ${HOME} -s /bin/bash -u 911 \
|
&& useradd -r moviepilot -g moviepilot -d ${HOME} -s /bin/bash -u 911 \
|
||||||
&& apt-get install -y build-essential \
|
&& apt-get install -y build-essential \
|
||||||
|
@ -27,8 +27,8 @@ gosu moviepilot:moviepilot playwright install chromium
|
|||||||
# 启动前端nginx服务
|
# 启动前端nginx服务
|
||||||
nginx
|
nginx
|
||||||
# 启动haproxy
|
# 启动haproxy
|
||||||
if [ -f "/var/run/docker.sock" ]; then
|
if [ -S "/var/run/docker.sock" ]; then
|
||||||
haproxy -f /etc/haproxy/haproxy.cfg
|
haproxy -f /app/haproxy.cfg
|
||||||
fi
|
fi
|
||||||
# 设置后端服务权限掩码
|
# 设置后端服务权限掩码
|
||||||
umask ${UMASK}
|
umask ${UMASK}
|
||||||
|
12
haproxy.cfg
12
haproxy.cfg
@ -12,6 +12,11 @@ global
|
|||||||
# Turn on stats unix socket
|
# Turn on stats unix socket
|
||||||
server-state-file /var/lib/haproxy/server-state
|
server-state-file /var/lib/haproxy/server-state
|
||||||
|
|
||||||
|
setenv POST 1
|
||||||
|
setenv ALLOW_RESTARTS 1
|
||||||
|
setenv CONTAINERS 1
|
||||||
|
setenv VERSION 1
|
||||||
|
|
||||||
defaults
|
defaults
|
||||||
mode http
|
mode http
|
||||||
log global
|
log global
|
||||||
@ -46,7 +51,10 @@ backend dockerbackend
|
|||||||
|
|
||||||
frontend dockerfrontend
|
frontend dockerfrontend
|
||||||
bind :2375
|
bind :2375
|
||||||
http-request allow
|
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)) }
|
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 }
|
||||||
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/version } { env(VERSION) -m bool }
|
||||||
http-request deny
|
http-request deny
|
||||||
default_backend dockerbackend
|
default_backend dockerbackend
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user