File tree Expand file tree Collapse file tree 5 files changed +14
-10
lines changed
src/routes/api/setup/whisper Expand file tree Collapse file tree 5 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 11# Use a specific version of Ubuntu as the base image
2- FROM ubuntu:22 .04
2+ FROM ubuntu:24 .04
33
44# Set environment variables to make installation non-interactive and set timezone
55ENV DEBIAN_FRONTEND=noninteractive \
@@ -8,6 +8,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
88
99# Combine all apt-get related commands to reduce layers and avoid multiple updates
1010RUN apt-get update && \
11+ apt-get upgrade -y && \
1112 apt-get install -y \
1213 python3 \
1314 python3-dev \
@@ -41,7 +42,8 @@ WORKDIR /app
4142
4243# Copy and install Python dependencies first to leverage caching
4344COPY requirements.txt .
44- RUN uv pip install --system -r requirements.txt
45+ RUN uv venv && \
46+ uv pip install -r requirements.txt
4547
4648# Copy package.json and package-lock.json separately to cache npm install
4749COPY package*.json ./
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
88
99# Combine all apt-get related commands to reduce layers and avoid multiple updates
1010RUN apt-get update && \
11+ apt-get upgrade -y && \
1112 apt-get install -y \
1213 python3 \
1314 python3-dev \
@@ -41,7 +42,8 @@ WORKDIR /app
4142
4243# Copy and install Python dependencies first to leverage caching
4344COPY requirements.txt .
44- RUN uv pip install --system -r requirements.txt
45+ RUN uv venv && \
46+ uv pip install -r requirements.txt
4547
4648# Copy package.json and package-lock.json separately to cache npm install
4749COPY package*.json ./
Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ services:
4343 POSTGRES_USER : ${POSTGRES_USER}
4444 POSTGRES_PASSWORD : ${POSTGRES_PASSWORD}
4545 POSTGRES_DB : ${POSTGRES_DB}
46- ports :
47- - " ${POSTGRES_PORT:-5432}:5432"
46+ # Uncomment the following lines if you want to access PostgreSQL from outside the container
47+ # ports:
48+ # - "${POSTGRES_PORT:-5432}:5432"
4849 volumes :
4950 # Comment out the following line if you want to use a local directory for PostgreSQL data storage
5051 - postgres_data:/var/lib/postgresql/data
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ if [ "$HARDWARE_ACCEL" = "gpu" ]; then
66 export HARDWARE_ACCEL=' cuda'
77fi
88
9+ # Active the python virtual environment
10+ source /app/.venv/bin/activate
911
1012# Function to wait for database to be ready
1113wait_for_db () {
4648echo " Building the application..."
4749exec " $@ "
4850
49- # Uncomment these lines if needed
50- # npm run build
51-
5251echo " Starting the application..."
5352node build
5453
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export const GET: RequestHandler = async ({ url }) => {
6060 sendMessage ( 'Installing dependencies...' , 0 ) ;
6161 try {
6262 await execWithProgress (
63- `python3 -m pip install torch==2.0.0 torchaudio==2.0.0 --index-url https://download.pytorch.org/whl/cpu` ,
63+ `uv pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu` ,
6464 { shell : true }
6565 ) ;
6666 } catch ( err ) {
@@ -73,7 +73,7 @@ export const GET: RequestHandler = async ({ url }) => {
7373 sendMessage ( 'Installing WhisperX...' , 30 ) ;
7474 try {
7575 await execWithProgress (
76- `python3 -m pip install whisperx` ,
76+ `uv pip install whisperx` ,
7777 { shell : true }
7878 ) ;
7979 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments