-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
53 lines (40 loc) · 1.11 KB
/
Dockerfile
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
FROM node:20-slim
# Prepare pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
# Update environment
RUN apt-get update && apt-get upgrade -y
# Install system dependencies
RUN apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
espeak-ng \
ffmpeg \
g++ \
# libsqlite3-dev required for Python
libsqlite3-dev
# Add Rust (required for building SudachiPy)
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:$PATH"
# Add Python
COPY --from=python:3.11-slim /usr/local /usr/local
# Set directory
WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
COPY src/lib/tts/preload_models.py src/lib/tts/
RUN python3 src/lib/tts/preload_models.py
# Install Node.js dependencies
COPY package.json pnpm-lock.yaml .
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --ignore-scripts
# Copy application files
COPY . .
# Build application
RUN pnpm build
# Create cache volume
VOLUME [ "/app/cache" ]
# Start app
CMD pnpm start