Skip to content

Commit b0ea16f

Browse files
committed
init docker build
1 parent d941b3f commit b0ea16f

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build & publish docker
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
-
11+
name: Checkout
12+
uses: actions/checkout@v4
13+
- run: |
14+
sudo apt-get install aria2
15+
aria2c --seed-time=1 --select-file=1 https://sukebei.nyaa.si/download/3914574.torrent -d .
16+
-
17+
name: Login to Docker Hub
18+
uses: docker/login-action@v3
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
-
23+
name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
-
26+
name: Build and push
27+
uses: docker/build-push-action@v5
28+
with:
29+
context: .
30+
file: ./Dockerfile
31+
push: true
32+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/comiclib:latest

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM python:3.11
2+
3+
WORKDIR /root
4+
5+
ENV content=/root/comiclib watch=False
6+
EXPOSE 8000
7+
8+
RUN apt-get -y update && apt-get -y install ffmpeg
9+
10+
COPY . /tmp/comiclib
11+
12+
RUN pip install --no-cache-dir -U "/tmp/comiclib[full]"
13+
RUN pip install --no-cache-dir -U gunicorn
14+
15+
ADD https://www.7-zip.org/a/7z2301-linux-x64.tar.xz /tmp/
16+
RUN tar -C /usr/bin/ -xvf /tmp/7z*.tar.xz 7zz
17+
18+
# Please download through BitTorrent yourself.
19+
RUN 7zz x /tmp/comiclib/e-hentai_*/api_dump.sqlite.7z
20+
RUN rm -r /tmp/*
21+
22+
RUN python3 -c "from comiclib import frontend_boost"
23+
24+
VOLUME /root
25+
26+
CMD [ "gunicorn", "comiclib.main:app", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8000", "--preload", "--workers", "4" ]

0 commit comments

Comments
 (0)