Skip to content

Commit 7771fe6

Browse files
authored
Merge pull request #107 from rishikanthc/fix/db-host-issue
Update CUDA support to version 12.8 and improve database configuration
2 parents dc2916d + 9aafe13 commit 7771fe6

File tree

8 files changed

+140
-189
lines changed

8 files changed

+140
-189
lines changed

Dockerfile

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,63 @@
1-
# Use a specific version of Ubuntu as the base image
2-
FROM ubuntu:24.04
3-
4-
# Set environment variables
5-
ENV DEBIAN_FRONTEND=noninteractive \
6-
TZ="Etc/UTC" \
7-
PATH="/root/.local/bin/:$PATH"
8-
9-
# Install minimal runtime dependencies
10-
RUN apt-get update && \
11-
apt-get install -y \
12-
python3 \
13-
python3-pip \
14-
python3-venv \
15-
postgresql-client \
16-
software-properties-common \
17-
tzdata \
18-
ffmpeg \
19-
curl \
20-
unzip \
21-
git && \
22-
# Add the PPA and install audiowaveform
23-
add-apt-repository ppa:chris-needham/ppa && \
24-
apt-get update && \
25-
apt-get install -y audiowaveform && \
26-
# Install UV
27-
curl -sSL https://astral.sh/uv/install.sh -o /uv-installer.sh && \
28-
sh /uv-installer.sh && \
29-
rm /uv-installer.sh && \
30-
# Install Node.js
31-
curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
32-
apt-get install -y nodejs && \
33-
# Clean up
34-
apt-get clean && \
35-
rm -rf /var/lib/apt/lists/*
36-
37-
# Set working directory
38-
WORKDIR /app
39-
40-
# Copy only the files needed for dependency installation and runtime
41-
COPY . .
42-
43-
# Copy environment variables for initial build
44-
# We use dynamic environment variables at runtime
45-
# No .env file needed during build
46-
47-
# Install node dependencies and build frontend
48-
RUN npm ci && \
49-
npm install && \
50-
npm run build
51-
52-
# Ensure entrypoint script is executable
53-
RUN chmod +x docker-entrypoint.sh
54-
55-
# Expose port
56-
EXPOSE 3000
57-
58-
# Remove environment variables file after build
59-
# No need to remove .env as we don't create it
60-
61-
# Define default command
1+
# Use a specific version of Ubuntu as the base image
2+
FROM ubuntu:24.04
3+
4+
# Set environment variables
5+
ENV DEBIAN_FRONTEND=noninteractive \
6+
TZ="Etc/UTC" \
7+
PATH="/root/.local/bin/:$PATH"
8+
9+
# Install minimal runtime dependencies
10+
RUN apt-get update && \
11+
apt-get install -y \
12+
python3 \
13+
python3-pip \
14+
python3-venv \
15+
postgresql-client \
16+
software-properties-common \
17+
tzdata \
18+
ffmpeg \
19+
curl \
20+
unzip \
21+
git && \
22+
# Add the PPA and install audiowaveform
23+
add-apt-repository ppa:chris-needham/ppa && \
24+
apt-get update && \
25+
apt-get install -y audiowaveform && \
26+
# Install UV
27+
curl -sSL https://astral.sh/uv/install.sh -o /uv-installer.sh && \
28+
sh /uv-installer.sh && \
29+
rm /uv-installer.sh && \
30+
# Install Node.js
31+
curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
32+
apt-get install -y nodejs && \
33+
# Clean up
34+
apt-get clean && \
35+
rm -rf /var/lib/apt/lists/*
36+
37+
# Set working directory
38+
WORKDIR /app
39+
40+
# Copy only the files needed for dependency installation and runtime
41+
COPY . .
42+
43+
# Copy environment variables for initial build
44+
# We use dynamic environment variables at runtime
45+
# No .env file needed during build
46+
47+
# Install node dependencies and build frontend
48+
RUN npm ci && \
49+
npm install && \
50+
npm run build
51+
52+
# Ensure entrypoint script is executable
53+
RUN chmod +x docker-entrypoint.sh
54+
55+
# Expose port
56+
EXPOSE 3000
57+
58+
# Remove environment variables file after build
59+
# No need to remove .env as we don't create it
60+
61+
# Define default command
62+
6263
CMD ["./docker-entrypoint.sh"]

Dockerfile-cuda128

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
FROM nvidia/cuda:12.8.0-cudnn-runtime-ubuntu24.04
2-
3-
# Set environment variables
4-
ENV DEBIAN_FRONTEND=noninteractive \
5-
TZ="Etc/UTC" \
6-
PATH="/root/.local/bin/:$PATH"
7-
8-
# Install minimal runtime dependencies
9-
RUN apt-get update && \
10-
apt-get install -y \
11-
python3 \
12-
python3-pip \
13-
python3-venv \
14-
postgresql-client \
15-
software-properties-common \
16-
tzdata \
17-
ffmpeg \
18-
curl \
19-
unzip \
20-
git && \
21-
# Add the PPA and install audiowaveform
22-
add-apt-repository ppa:chris-needham/ppa && \
23-
apt-get update && \
24-
apt-get install -y audiowaveform && \
25-
# Install UV
26-
curl -sSL https://astral.sh/uv/install.sh -o /uv-installer.sh && \
27-
sh /uv-installer.sh && \
28-
rm /uv-installer.sh && \
29-
# Install Node.js
30-
curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
31-
apt-get install -y nodejs && \
32-
# Clean up
33-
apt-get clean && \
34-
rm -rf /var/lib/apt/lists/*
35-
36-
# Set working directory
37-
WORKDIR /app
38-
39-
40-
# Copy files to container
41-
COPY . .
42-
43-
# Copy environment variables for initial build
44-
# We use dynamic environment variables at runtime
45-
# No .env file needed during build
46-
47-
# Install node dependencies and build frontend
48-
RUN npm ci && \
49-
npm install && \
50-
npm run build
51-
52-
# Ensure entrypoint script is executable
53-
RUN chmod +x docker-entrypoint.sh
54-
55-
# Expose port
56-
EXPOSE 3000
57-
58-
# Remove environment variables file after build
59-
# No need to remove .env as we don't create it
60-
61-
# Define default command
1+
FROM nvidia/cuda:12.8.0-cudnn-runtime-ubuntu24.04
2+
3+
# Set environment variables
4+
ENV DEBIAN_FRONTEND=noninteractive \
5+
TZ="Etc/UTC" \
6+
PATH="/root/.local/bin/:$PATH"
7+
8+
# Install minimal runtime dependencies
9+
RUN apt-get update && \
10+
apt-get install -y \
11+
python3 \
12+
python3-pip \
13+
python3-venv \
14+
postgresql-client \
15+
software-properties-common \
16+
tzdata \
17+
ffmpeg \
18+
curl \
19+
unzip \
20+
git && \
21+
# Add the PPA and install audiowaveform
22+
add-apt-repository ppa:chris-needham/ppa && \
23+
apt-get update && \
24+
apt-get install -y audiowaveform && \
25+
# Install UV
26+
curl -sSL https://astral.sh/uv/install.sh -o /uv-installer.sh && \
27+
sh /uv-installer.sh && \
28+
rm /uv-installer.sh && \
29+
# Install Node.js
30+
curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
31+
apt-get install -y nodejs && \
32+
# Clean up
33+
apt-get clean && \
34+
rm -rf /var/lib/apt/lists/*
35+
36+
# Set working directory
37+
WORKDIR /app
38+
39+
# Copy files to container
40+
COPY . .
41+
42+
# Copy environment variables for initial build
43+
# We use dynamic environment variables at runtime
44+
# No .env file needed during build
45+
46+
# Install node dependencies and build frontend
47+
48+
RUN npm ci && \
49+
npm install && \
50+
npm run build
51+
52+
# Ensure entrypoint script is executable
53+
RUN chmod +x docker-entrypoint.sh
54+
55+
# Expose port
56+
EXPOSE 3000
57+
58+
# Remove environment variables file after build
59+
# No need to remove .env as we don't create it
60+
61+
# Define default command
6262
CMD ["./docker-entrypoint.sh"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Rishikanth Chandrasekaran
3+
Copyright (c) 2025 Rishikanth Chandrasekaran
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docker-compose.gpu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ services:
44
app:
55
build:
66
context: .
7-
dockerfile: Dockerfile-gpu
7+
dockerfile: Dockerfile-cuda128
88
# You can find your architecture by running: nvidia-smi if on linux
99
# You can find your architecture by running: system_profiler SPDisplaysDataType if on mac
1010
# You can find your architecture by running: wmic path win32_videocontroller get name if on windows
1111
# You will need to change the image to match your architecture, E.G. "main-cuda-11"
12-
image: ghcr.io/rishikanthc/scriberr:main-cuda-11
12+
image: ghcr.io/rishikanthc/scriberr:main-cuda128
1313
deploy:
1414
resources:
1515
reservations:

docker-compose.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ services:
99
# No args needed as environment variables are passed at runtime
1010
env_file:
1111
- .env
12+
environment:
13+
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
1214
ports:
1315
- "${PORT:-3000}:3000"
1416
volumes:
1517
- scriberr_data:/scriberr
1618
networks:
1719
- app-network
20+
healthcheck:
21+
test: ["CMD-SHELL", "curl -f http://localhost:3000/health || exit 1"]
22+
interval: 30s
23+
timeout: 10s
24+
retries: 5
1825
depends_on:
1926
db:
2027
condition: service_healthy
@@ -31,7 +38,7 @@ services:
3138
volumes:
3239
- postgres_data:/var/lib/postgresql/data
3340
healthcheck:
34-
test: ["CMD-SHELL", "pg_isready -U root -d local"]
41+
test: ["CMD-SHELL", "pg_isready -U root -d ${POSTGRES_DB}"]
3542
interval: 5s
3643
timeout: 5s
3744
retries: 5

docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ wait_for_db() {
2626
echo "Waiting for database to be ready..."
2727
echo "Current DATABASE_URL: $DATABASE_URL"
2828

29-
until PGPASSWORD="$POSTGRES_PASSWORD" pg_isready -h db -p 5432 -U "$POSTGRES_USER" -d "$POSTGRES_DB"
29+
until PGPASSWORD="$POSTGRES_PASSWORD" pg_isready -h $POSTGRES_HOST -p 5432 -U "$POSTGRES_USER" -d "$POSTGRES_DB"
3030
do
3131
echo "Database connection attempt failed. Retrying in 2 seconds..."
3232
sleep 2
@@ -77,7 +77,7 @@ install_dependencies() {
7777

7878
# Install PyTorch based on hardware
7979
if [ "$HARDWARE_ACCEL" = "cuda" ]; then
80-
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
80+
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
8181
uv pip install nvidia-cudnn-cu11==8.9.6.50
8282
echo "PyTorch with CUDA installed."
8383
else

env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ PORT=3000 # Port to use for running the web interface
77
POSTGRES_PORT=5432 # Port to use for PostgreSQL database
88
POSTGRES_USER=root # Username for PostgreSQL database
99
POSTGRES_PASSWORD=mysecretpassword # Password for PostgreSQL database
10+
POSTGRES_HOST=db # Hostname for PostgreSQL database
1011
POSTGRES_DB=local # Database name
11-
DATABASE_URL=postgres://root:mysecretpassword@db:5432/local # Database URL for connection to PostgreSQL database with credentials from above
12+
13+
# Made using the variables from above. Will be removed in later versions.
14+
# DATABASE_URL=postgres://root:mysecretpassword@db:5432/local # Database URL for connection to PostgreSQL database with credentials from above
1215

1316
# Application configuration
1417
ADMIN_USERNAME=admin # Username for admin user in web interface

transcript.json

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)