Sign inSign up

cwavguy/ottohuozi-flask-py3.9-alpine

By cwavguy

•Updated about 4 years ago

hanhanhao!

Image
1

155

cwavguy/ottohuozi-flask-py3.9-alpine repository overview

⁠HUOZI本体

https://www.bilibili.com/video/BV1sZ4y1b7rf⁠

https://github.com/sakaneko117/HUOZI⁠

https://github.com/CwavGuy/HUOZI_aolianfeiallin.top⁠

⁠=== 【最新】适用于ffmpeg-1.1.2版 ===

⁠requirements.txt (和Dockerfile放在一起)

soundfile==0.11.0
pydub==0.25.1
numpy==1.23.3
pypinyin==0.47.1
playsound==1.3.0
Flask==2.2.2
psola==0.0.1
gunicorn==20.1.0
gevent==21.12.0

⁠gunicorn.conf.py (放在HUOZI文件夹内)

workers = 5 # 定义同时开启的处理请求的进程数量,根据网站流量适当调整
worker_class = "gevent" # 采用gevent库,支持异步处理请求,提高吞吐量
bind = "0.0.0.0:80"

⁠Dockerfile (建议单独开个空白文件夹,同文件夹内必须有requirements.txt)

FROM python:3.9-alpine

WORKDIR /var/python

COPY requirements.txt ./

RUN apk update && \
apk add --no-cache ffmpeg libsndfile-dev && \
apk add --no-cache --virtual .build-deps build-base libx11-dev libffi-dev gcc musl-dev make && \
pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
apk del .build-deps build-base libx11-dev libffi-dev gcc musl-dev make

RUN mkdir /usr/local/lib/python3.9/site-packages/_soundfile_data && \
ln -s /usr/lib/libsndfile.so /usr/local/lib/python3.9/site-packages/_soundfile_data/libsndfile.so && \
rm -rf /var/cache/apk/*

WORKDIR /home/ubuntu/HUOZI/

EXPOSE 80

CMD ["gunicorn", "app:app", "-c", "./gunicorn.conf.py"]

⁠docker-compose.yml (诶乌兹诶乌兹诶乌兹哈比下)

version: "3"

services:

huozi:

image: cwavguy/ottohuozi-flask-py3.9-alpine:ffmpeg-1.1.2

container_name: huozi

user: "1000:1000"

volumes:

  - ./HUOZI:/home/ubuntu/HUOZI/

ports:

  - 80:80

networks:

  - default

  - app_net

restart: always

networks:

app_net:

external: true

⁠=== 适用于ffmpeg-1.1版 ===

⁠requirements.txt (和Dockerfile放在一起)

pydub==0.25.1
pypinyin==0.46.0
playsound==1.3.0
flask_limiter==2.6.3
flask==2.1.2
gunicorn==20.1.0
gevent==21.12.0

⁠gunicorn.conf.py (放在HUOZI文件夹内)

workers = 5 # 定义同时开启的处理请求的进程数量,根据网站流量适当调整
worker_class = "gevent" # 采用gevent库,支持异步处理请求,提高吞吐量
bind = "0.0.0.0:80"

⁠Dockerfile (建议单独开个空白文件夹,同文件夹内必须有requirements.txt)

FROM python:3.9-alpine

WORKDIR /var/python

COPY requirements.txt ./

RUN apk update && \
apk add --no-cache ca-certificates ffmpeg && \
apk add --no-cache --virtual .build-deps build-base libffi-dev gcc musl-dev make && \
pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
apk del .build-deps build-base libffi-dev gcc musl-dev make && \
rm -rf /var/cache/apk/*

WORKDIR /home/ubuntu/HUOZI/

EXPOSE 80

CMD ["gunicorn", "app:app", "-c", "./gunicorn.conf.py"]

⁠docker-compose.yml (诶乌兹诶乌兹诶乌兹哈比下)

version: "2.1"

services:

huozi:

image: cwavguy/ottohuozi-flask-py3.9-alpine:ffmpeg-1.1

container_name: huozi

volumes:

  - ./HUOZI:/home/ubuntu/HUOZI/

ports:

  - 80:80

networks:

  - default

restart: always

Tag summary

Content type

Image

Digest

sha256:3a357e4cf…

Size

120.5 MB

Last updated

about 4 years ago

docker pull cwavguy/ottohuozi-flask-py3.9-alpine:ffmpeg-1.1.2