Skip to content

Commit b58d98d

Browse files
authored
Merge pull request #60 from rishikanthc/fix/docker-arm64-build
Update GPU configuration, Docker setup, Fixed Arm64 build error
2 parents 6c40cb4 + b1d4f65 commit b58d98d

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
55
ENV 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
1010
RUN 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
4344
COPY 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
4749
COPY package*.json ./

Dockerfile-gpu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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
1010
RUN 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
4344
COPY 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
4749
COPY package*.json ./

docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

docker-entrypoint.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if [ "$HARDWARE_ACCEL" = "gpu" ]; then
66
export HARDWARE_ACCEL='cuda'
77
fi
88

9+
# Active the python virtual environment
10+
source /app/.venv/bin/activate
911

1012
# Function to wait for database to be ready
1113
wait_for_db() {
@@ -46,9 +48,6 @@ fi
4648
echo "Building the application..."
4749
exec "$@"
4850

49-
# Uncomment these lines if needed
50-
# npm run build
51-
5251
echo "Starting the application..."
5352
node build
5453

src/routes/api/setup/whisper/+server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)