forked from Open-LLM-VTuber/Open-LLM-VTuber
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
81 lines (71 loc) · 2.11 KB
/
dockerfile
File metadata and controls
81 lines (71 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
UV_LINK_MODE=copy \
CONFIG_FILE=/app/conf/conf.yaml
WORKDIR /app
# Base dependencies
RUN apt-get update -o Acquire::Retries=5 \
&& apt-get install -y --no-install-recommends \
ffmpeg git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
# Install deps (cache-friendly)
COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
# Copy source & install project
COPY . /app
RUN uv pip install --no-deps .
# Startup script
RUN printf '%s\n' \
'#!/usr/bin/env sh' \
'set -eu' \
'' \
'mkdir -p /app/conf /app/models' \
'' \
'# 1) conf.yaml (required)' \
'if [ -f "/app/conf/conf.yaml" ]; then' \
' echo "Using user-provided conf.yaml"' \
' ln -sf /app/conf/conf.yaml /app/conf.yaml' \
'else' \
' echo "ERROR: conf.yaml is required."' \
' echo "Please mount your config dir to /app/conf"' \
' exit 1' \
'fi' \
'' \
'# 2) model_dict.json (optional)' \
'if [ -f "/app/conf/model_dict.json" ]; then' \
' ln -sf /app/conf/model_dict.json /app/model_dict.json' \
'fi' \
'' \
'# 3) live2d-models' \
'if [ -d "/app/conf/live2d-models" ]; then' \
' rm -rf /app/live2d-models && ln -s /app/conf/live2d-models /app/live2d-models' \
'fi' \
'' \
'# 4) characters' \
'if [ -d "/app/conf/characters" ]; then' \
' rm -rf /app/characters && ln -s /app/conf/characters /app/characters' \
'fi' \
'' \
'# 5) avatars' \
'if [ -d "/app/conf/avatars" ]; then' \
' rm -rf /app/avatars && ln -s /app/conf/avatars /app/avatars' \
'fi' \
'' \
'# 6) backgrounds' \
'if [ -d "/app/conf/backgrounds" ]; then' \
' rm -rf /app/backgrounds && ln -s /app/conf/backgrounds /app/backgrounds' \
'fi' \
'' \
'# 7) start app' \
'exec uv run run_server.py' \
> /usr/local/bin/start-app && chmod +x /usr/local/bin/start-app
# Volumes
VOLUME ["/app/conf", "/app/models"]
EXPOSE 12393
CMD ["/usr/local/bin/start-app"]