Skip to content

Rebase Nightly Branch #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 62 additions & 61 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
# Use a specific version of Ubuntu as the base image
FROM ubuntu:24.04

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive \
TZ="Etc/UTC" \
PATH="/root/.local/bin/:$PATH"

# Install minimal runtime dependencies
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip \
python3-venv \
postgresql-client \
software-properties-common \
tzdata \
ffmpeg \
curl \
unzip \
git && \
# Add the PPA and install audiowaveform
add-apt-repository ppa:chris-needham/ppa && \
apt-get update && \
apt-get install -y audiowaveform && \
# Install UV
curl -sSL https://astral.sh/uv/install.sh -o /uv-installer.sh && \
sh /uv-installer.sh && \
rm /uv-installer.sh && \
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
apt-get install -y nodejs && \
# Clean up
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy only the files needed for dependency installation and runtime
COPY . .

# Copy environment variables for initial build
# We use dynamic environment variables at runtime
# No .env file needed during build

# Install node dependencies and build frontend
RUN npm ci && \
npm install && \
npm run build

# Ensure entrypoint script is executable
RUN chmod +x docker-entrypoint.sh

# Expose port
EXPOSE 3000

# Remove environment variables file after build
# No need to remove .env as we don't create it

# Define default command
# Use a specific version of Ubuntu as the base image
FROM ubuntu:24.04

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive \
TZ="Etc/UTC" \
PATH="/root/.local/bin/:$PATH"

# Install minimal runtime dependencies
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip \
python3-venv \
postgresql-client \
software-properties-common \
tzdata \
ffmpeg \
curl \
unzip \
git && \
# Add the PPA and install audiowaveform
add-apt-repository ppa:chris-needham/ppa && \
apt-get update && \
apt-get install -y audiowaveform && \
# Install UV
curl -sSL https://astral.sh/uv/install.sh -o /uv-installer.sh && \
sh /uv-installer.sh && \
rm /uv-installer.sh && \
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
apt-get install -y nodejs && \
# Clean up
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy only the files needed for dependency installation and runtime
COPY . .

# Copy environment variables for initial build
# We use dynamic environment variables at runtime
# No .env file needed during build

# Install node dependencies and build frontend
RUN npm ci && \
npm install && \
npm run build

# Ensure entrypoint script is executable
RUN chmod +x docker-entrypoint.sh

# Expose port
EXPOSE 3000

# Remove environment variables file after build
# No need to remove .env as we don't create it

# Define default command

CMD ["./docker-entrypoint.sh"]
122 changes: 61 additions & 61 deletions Dockerfile-cuda128
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
FROM nvidia/cuda:12.8.0-cudnn-runtime-ubuntu24.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive \
TZ="Etc/UTC" \
PATH="/root/.local/bin/:$PATH"
# Install minimal runtime dependencies
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip \
python3-venv \
postgresql-client \
software-properties-common \
tzdata \
ffmpeg \
curl \
unzip \
git && \
# Add the PPA and install audiowaveform
add-apt-repository ppa:chris-needham/ppa && \
apt-get update && \
apt-get install -y audiowaveform && \
# Install UV
curl -sSL https://astral.sh/uv/install.sh -o /uv-installer.sh && \
sh /uv-installer.sh && \
rm /uv-installer.sh && \
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
apt-get install -y nodejs && \
# Clean up
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy files to container
COPY . .
# Copy environment variables for initial build
# We use dynamic environment variables at runtime
# No .env file needed during build
# Install node dependencies and build frontend
RUN npm ci && \
npm install && \
npm run build
# Ensure entrypoint script is executable
RUN chmod +x docker-entrypoint.sh
# Expose port
EXPOSE 3000
# Remove environment variables file after build
# No need to remove .env as we don't create it
# Define default command
FROM nvidia/cuda:12.8.0-cudnn-runtime-ubuntu24.04

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive \
TZ="Etc/UTC" \
PATH="/root/.local/bin/:$PATH"

# Install minimal runtime dependencies
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip \
python3-venv \
postgresql-client \
software-properties-common \
tzdata \
ffmpeg \
curl \
unzip \
git && \
# Add the PPA and install audiowaveform
add-apt-repository ppa:chris-needham/ppa && \
apt-get update && \
apt-get install -y audiowaveform && \
# Install UV
curl -sSL https://astral.sh/uv/install.sh -o /uv-installer.sh && \
sh /uv-installer.sh && \
rm /uv-installer.sh && \
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
apt-get install -y nodejs && \
# Clean up
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy files to container
COPY . .

# Copy environment variables for initial build
# We use dynamic environment variables at runtime
# No .env file needed during build

# Install node dependencies and build frontend

RUN npm ci && \
npm install && \
npm run build

# Ensure entrypoint script is executable
RUN chmod +x docker-entrypoint.sh

# Expose port
EXPOSE 3000

# Remove environment variables file after build
# No need to remove .env as we don't create it

# Define default command
CMD ["./docker-entrypoint.sh"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Rishikanth Chandrasekaran
Copyright (c) 2025 Rishikanth Chandrasekaran

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ If you wish to build the Docker images yourself, you can use the provided `Docke
#### CPU Image

```bash
docker build -t scriberr:latest -f Dockerfile .
docker build -t scriberr:main -f Dockerfile .
```

#### GPU Image

```bash
docker build -t scriberr:latest-gpu -f Dockerfile-cuda128 .
docker build -t scriberr:main-cuda128 -f Dockerfile-cuda128 .
```

### Advanced Configuration
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ services:
app:
build:
context: .
dockerfile: Dockerfile-gpu
dockerfile: Dockerfile-cuda128
# You can find your architecture by running: nvidia-smi if on linux
# You can find your architecture by running: system_profiler SPDisplaysDataType if on mac
# You can find your architecture by running: wmic path win32_videocontroller get name if on windows
# You will need to change the image to match your architecture, E.G. "main-cuda-11"
image: ghcr.io/rishikanthc/scriberr:main-cuda-11
image: ghcr.io/rishikanthc/scriberr:main-cuda128
deploy:
resources:
reservations:
Expand Down
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ services:
# No args needed as environment variables are passed at runtime
env_file:
- .env
environment:
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
ports:
- "${PORT:-3000}:3000"
volumes:
- scriberr_data:/scriberr
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
depends_on:
db:
condition: service_healthy
Expand All @@ -31,7 +38,7 @@ services:
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U root -d local"]
test: ["CMD-SHELL", "pg_isready -U root -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
Expand Down
4 changes: 2 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ wait_for_db() {
echo "Waiting for database to be ready..."
echo "Current DATABASE_URL: $DATABASE_URL"

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

# Install PyTorch based on hardware
if [ "$HARDWARE_ACCEL" = "cuda" ]; then
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
uv pip install nvidia-cudnn-cu11==8.9.6.50
echo "PyTorch with CUDA installed."
else
Expand Down
5 changes: 4 additions & 1 deletion env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ PORT=3000 # Port to use for running the web interface
POSTGRES_PORT=5432 # Port to use for PostgreSQL database
POSTGRES_USER=root # Username for PostgreSQL database
POSTGRES_PASSWORD=mysecretpassword # Password for PostgreSQL database
POSTGRES_HOST=db # Hostname for PostgreSQL database
POSTGRES_DB=local # Database name
DATABASE_URL=postgres://root:mysecretpassword@db:5432/local # Database URL for connection to PostgreSQL database with credentials from above

# Made using the variables from above. Will be removed in later versions.
# DATABASE_URL=postgres://root:mysecretpassword@db:5432/local # Database URL for connection to PostgreSQL database with credentials from above

# Application configuration
ADMIN_USERNAME=admin # Username for admin user in web interface
Expand Down
Loading
Loading