https://github.com/sxyazi/free-hls
cd /var/www
git clone https://github.com/sxyazi/free-hls.git
cd free-hls
把APP 映射到宿主机/mnt/free-hls/app
- app:/var/app
+ - /mnt/hdd/free-hls/uploads:/var/app/web/uploads
....
volumes:
app:
完整如下:
version: '2'
services:
free-hls:
build: .
container_name: 'free-hls'
volumes:
- app:/var/app
- /mnt/hdd/free-hls/uploads:/var/app/web/uploads
logging:
options:
max-size: '1G'
max-file: '10'
ports:
- '33950:3395'
restart: always
volumes:
app:
容器启动后,进入容器,修改配置文件.env
docker exec -it free-hls /bin/ash
cd web
cp .env.example .env
vi .env
CLOSEUI=NO
SECRET=NONE
ENABLE_UPLOAD=YES
重启容器
docker compose restart
错误1
4.426 error: externally-managed-environment
4.426
4.426 × This environment is externally managed
4.426 ╰─>
4.426 The system-wide python installation should be maintained using the system
4.426 package manager (apk) only.
4.426
4.426 If the package in question is not packaged already (and hence installable via
4.426 "apk add py3-somepackage"), please consider installing it inside a virtual
4.426 environment, e.g.:
4.426
4.426 python3 -m venv /path/to/venv
4.426 . /path/to/venv/bin/activate
4.426 pip install mypackage
4.426
4.426 To exit the virtual environment, run:
4.426
4.426 deactivate
4.426
4.426 The virtual environment is not deleted, and can be re-entered by re-sourcing
4.426 the activate file.
4.426
4.426 To automatically manage virtual environments, consider using pipx (from the
4.426 pipx package).
4.426
4.426 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
4.426 hint: See PEP 668 for the detailed specification.
------
failed to solve: process "/bin/sh -c apk update && apk add python3 py3-pip && pip3 install Flask peewee gunicorn python-dotenv" did not complete successfully: exit code: 1
GPT-4 给的解决方法,修改Dockerfile 修改venv
FROM alpine
RUN apk update \
&& apk add python3 py3-pip \
&& python3 -m venv /var/venv \
&& . /var/venv/bin/activate \
&& pip install Flask peewee gunicorn python-dotenv
WORKDIR /var/app
COPY . .
WORKDIR /var/app/web
ENTRYPOINT ["/var/venv/bin/gunicorn","app:app","-b","0.0.0.0:3395","--workers=5","--threads=2"]
EXPOSE 3395
还没有人评论,抢个沙发吧...