mirror of https://github.com/Xhofe/alist
pikpak 自动登陆验证 加入到docker中 ai识别python的文件较大
parent
7c6c79ca2e
commit
188276eab5
54
Dockerfile
54
Dockerfile
|
@ -1,26 +1,60 @@
|
||||||
FROM alpine:edge as builder
|
FROM ubuntu AS build_alist
|
||||||
LABEL stage=go-builder
|
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
RUN apk add --no-cache bash curl gcc git go musl-dev
|
# RUN apt update && apt install bash curl gcc git go musl-dev
|
||||||
|
# 安装基本工具
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y software-properties-common && \
|
||||||
|
add-apt-repository ppa:longsleep/golang-backports && \
|
||||||
|
apt update && \
|
||||||
|
apt install -y bash curl gcc git golang-go musl-dev
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
RUN bash build.sh release docker
|
RUN bash build.sh release docker
|
||||||
|
|
||||||
FROM alpine:edge
|
FROM ubuntu AS install_py
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y curl python3 python3-pip python3.12-venv
|
||||||
|
WORKDIR /app/auto_pikpak/
|
||||||
|
# RUN curl -O -L https://raw.githubusercontent.com/wangjunkai2022/auto_pikpak/main/requirements.txt requirements.txt
|
||||||
|
# RUN curl -O -L https://raw.githubusercontent.com/wangjunkai2022/auto_pikpak/main/requirements.txt requirements.txt
|
||||||
|
# 创建虚拟环境并激活
|
||||||
|
RUN python3 -m venv venv && \
|
||||||
|
. venv/bin/activate && \
|
||||||
|
pip install \
|
||||||
|
PyYAML \
|
||||||
|
selenium \
|
||||||
|
pyTelegramBotAPI \
|
||||||
|
pyrclone \
|
||||||
|
httpx \
|
||||||
|
numpy \
|
||||||
|
opencv_python \
|
||||||
|
opencv_python_headless \
|
||||||
|
ultralytics \
|
||||||
|
2captcha-python \
|
||||||
|
Flask
|
||||||
|
|
||||||
|
FROM ubuntu as pikpak_server
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y git
|
||||||
|
WORKDIR /app
|
||||||
|
RUN git clone https://github.com/wangjunkai2022/auto_pikpak.git --depth 1
|
||||||
|
WORKDIR /app/auto_pikpak
|
||||||
|
COPY --from=install_py /app/auto_pikpak/venv /app/auto_pikpak/venv
|
||||||
|
|
||||||
|
FROM ubuntu
|
||||||
ARG INSTALL_FFMPEG=false
|
ARG INSTALL_FFMPEG=false
|
||||||
LABEL MAINTAINER="i@nn.ci"
|
LABEL MAINTAINER="i@nn.ci"
|
||||||
|
|
||||||
WORKDIR /opt/alist/
|
WORKDIR /opt/alist/
|
||||||
|
|
||||||
RUN apk update && \
|
RUN apt update && \
|
||||||
apk upgrade --no-cache && \
|
apt upgrade -y && \
|
||||||
apk add --no-cache bash ca-certificates su-exec tzdata; \
|
apt install -y bash ca-certificates tzdata ffmpeg
|
||||||
[ "$INSTALL_FFMPEG" = "true" ] && apk add --no-cache ffmpeg; \
|
|
||||||
rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
COPY --from=builder /app/bin/alist ./
|
# 复制 auto_pikpak 到第二阶段
|
||||||
|
COPY --from=pikpak_server /app/auto_pikpak /app/auto_pikpak
|
||||||
|
COPY --from=build_alist /app/bin/alist ./
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh && /entrypoint.sh version
|
RUN chmod +x /entrypoint.sh && /entrypoint.sh version
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,16 @@
|
||||||
chown -R ${PUID}:${PGID} /opt/alist/
|
chown -R ${PUID}:${PGID} /opt/alist/
|
||||||
|
|
||||||
umask ${UMASK}
|
umask ${UMASK}
|
||||||
|
# 指定 Python 程序的工作目录
|
||||||
|
PYTHON_DIR="/app/auto_pikpak"
|
||||||
|
|
||||||
|
# 启动 Python 程序
|
||||||
|
(
|
||||||
|
cd "$PYTHON_DIR" && /app/auto_pikpak/venv/bin/python3 server.py &
|
||||||
|
)
|
||||||
|
|
||||||
if [ "$1" = "version" ]; then
|
if [ "$1" = "version" ]; then
|
||||||
./alist version
|
./alist version
|
||||||
else
|
else
|
||||||
exec su-exec ${PUID}:${PGID} ./alist server --no-prefix
|
exec ./alist server --no-prefix
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue