Compare commits
7 Commits
v1.2.0
...
renovate/c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7127a9c28f | ||
|
5a53e1a782
|
|||
|
b0e430e19d
|
|||
|
383af5a61e
|
|||
|
67593cc678
|
|||
|
4570d10238
|
|||
|
c05cd29028
|
23
Dockerfile
23
Dockerfile
@@ -1,19 +1,34 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
|
# Install dependencies + locales
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
libgl1 \
|
libgl1 \
|
||||||
libglib2.0-0 \
|
libglib2.0-0 \
|
||||||
zip \
|
p7zip-full \
|
||||||
|
locales \
|
||||||
|
fonts-noto-cjk \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Generate Japanese UTF-8 locale
|
||||||
|
RUN sed -i '/ja_JP.UTF-8/s/^# //g' /etc/locale.gen \
|
||||||
|
&& locale-gen
|
||||||
|
|
||||||
|
# Set environment variables for locale
|
||||||
|
ENV LANG=ja_JP.UTF-8 \
|
||||||
|
LANGUAGE=ja_JP:ja \
|
||||||
|
LC_ALL=ja_JP.UTF-8 \
|
||||||
|
LC_CTYPE=ja_JP.UTF-8
|
||||||
|
|
||||||
RUN pip install --no-cache-dir --upgrade torch torchvision mokuro
|
RUN pip install --no-cache-dir --upgrade torch torchvision mokuro
|
||||||
|
|
||||||
# create a user to run the application
|
# create a user to run the application
|
||||||
RUN useradd -m mokurouser \
|
RUN useradd -m mokurouser \
|
||||||
&& mkdir -p /home/mokurouser/mokuro \
|
&& mkdir -p /mokuro \
|
||||||
&& chown -R mokurouser:mokurouser /home/mokurouser
|
&& chown -R mokurouser:mokurouser /mokuro
|
||||||
|
|
||||||
WORKDIR /home/mokurouser/mokuro
|
WORKDIR /mokuro
|
||||||
|
|
||||||
|
USER mokurouser
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
---
|
---
|
||||||
services:
|
services:
|
||||||
mokuro:
|
mokuro:
|
||||||
image: gitea.suda.codes/sudacode/mokuro-docker:latest
|
image: mokuro
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: mokuro
|
container_name: mokuro
|
||||||
user: 1000:1000
|
user: 1000:1000
|
||||||
volumes:
|
volumes:
|
||||||
- ~/S/japanese/manga:/home/mokurouser/mokuro
|
- ~/S/japanese/manga:/mokuro/manga
|
||||||
command: mokuro --parent_dir One\ Piece\ Color --disable_confirmation && ./zip.sh "One Piece Color"
|
command: ./run.sh "manga/One Piece Color"
|
||||||
runtime: nvidia
|
runtime: nvidia
|
||||||
restart: no
|
restart: no
|
||||||
network_mode: host
|
network_mode: host
|
||||||
|
|||||||
6
renovate.json
Normal file
6
renovate.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"config:recommended"
|
||||||
|
]
|
||||||
|
}
|
||||||
38
run.sh
Executable file
38
run.sh
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -Eeuo pipefail
|
||||||
|
export LANG=ja_JP.UTF-8
|
||||||
|
export LANGUAGE=ja_JP:ja
|
||||||
|
export LC_ALL=ja_JP.UTF-8
|
||||||
|
export LC_CTYPE=ja_JP.UTF-8
|
||||||
|
|
||||||
|
DIR="${1:-.}"
|
||||||
|
|
||||||
|
if [[ ! -d "$DIR" ]]; then
|
||||||
|
echo "Error: Directory '$DIR' does not exist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! mokuro --parent_dir "$DIR" --disable_confirmation; then
|
||||||
|
echo "Error: mokuro command failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$DIR" || exit
|
||||||
|
|
||||||
|
for f in *.mokuro; do
|
||||||
|
[[ -e "$f" ]] || continue
|
||||||
|
base="${f%.mokuro}"
|
||||||
|
dir="$base"
|
||||||
|
zipfile="$base.zip"
|
||||||
|
if [[ -f "$zipfile" ]]; then
|
||||||
|
echo "Warning: Zip file $zipfile already exists, skipping."
|
||||||
|
elif [[ -d "$dir" ]]; then
|
||||||
|
echo "Zipping: $zipfile <- $f $dir/"
|
||||||
|
7z a -tzip "$zipfile" "$f" "$dir"
|
||||||
|
else
|
||||||
|
echo "Warning: Directory '$dir' not found for '$f', skipping."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -rf ./*.html
|
||||||
21
zip.sh
21
zip.sh
@@ -1,21 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Usage: ./zip.sh [directory]
|
|
||||||
# Default is current directory
|
|
||||||
set -Eeuo pipefail
|
|
||||||
|
|
||||||
DIR="${1:-.}"
|
|
||||||
|
|
||||||
cd "$DIR" || exit
|
|
||||||
|
|
||||||
for f in *.mokuro; do
|
|
||||||
[ -e "$f" ] || continue # skip if no .mokuro files
|
|
||||||
base="${f%.mokuro}"
|
|
||||||
dir="$base"
|
|
||||||
zipfile="$base.zip"
|
|
||||||
if [ -d "$dir" ]; then
|
|
||||||
echo "Zipping: $zipfile <- $f $dir/"
|
|
||||||
zip -qr "$zipfile" "$f" "$dir"
|
|
||||||
else
|
|
||||||
echo "Warning: Directory '$dir' not found for '$f', skipping."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
Reference in New Issue
Block a user