forked from Chenyme/Chenyme-AAVT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Chenyme#52 from Eisaichen/main
New docker image for Linux and actions for auto push
- Loading branch information
Showing
7 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
pull: true | ||
push: true | ||
tags: chenyme/chenyme-aavt:latest,chenyme/chenyme-aavt:${{ github.sha }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM python:3.11 | ||
|
||
EXPOSE 8501 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
COPY . /app | ||
|
||
RUN apt update && \ | ||
apt install ffmpeg rsync fonts-wqy-zenhei fonts-wqy-microhei -y && \ | ||
apt clean && \ | ||
addgroup --gid 1000 chenymeaavt && \ | ||
adduser --uid 1000 --ingroup chenymeaavt --disabled-password chenymeaavt && \ | ||
pip cache purge && \ | ||
chown 1000:1000 /app -R && \ | ||
chmod +x /app/entry.sh | ||
|
||
USER chenymeaavt | ||
WORKDIR /app | ||
|
||
RUN python -m venv . && \ | ||
. ./bin/activate && \ | ||
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 && \ | ||
pip install -r /app/requirements.txt && \ | ||
pip cache purge && \ | ||
mv config _config && \ | ||
mv cache _cache && \ | ||
mv model _model && \ | ||
mkdir config cache model | ||
|
||
ENTRYPOINT ["./entry.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
networks: | ||
chenyme-aavt: | ||
|
||
services: | ||
chenyme-aavt: | ||
container_name: chenyme-aavt | ||
image: chenyme/chenyme-aavt:latest | ||
restart: unless-stopped | ||
networks: | ||
- chenyme-aavt | ||
ports: | ||
- "8501:8501" # Web GUI | ||
volumes: | ||
- './conf:/app/config' | ||
- './model:/app/model' | ||
- './output:/app/cache' # Output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
rsync -a --ignore-existing /app/_config/ /app/config/ > /dev/null | ||
rsync -a --ignore-existing /app/_model/ /app/model/ > /dev/null | ||
rsync -a --ignore-existing /app/_cache/ /app/cache/ > /dev/null | ||
|
||
. ./bin/activate | ||
python ./styles/info.py | ||
streamlit run Chenyme-AAVT.py --browser.gatherUsageStats false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters