Files
Scriberr/Dockerfile
SpirusNox 76a85e11b3 Refactor and update Docker configurations
- Updated `.dockerignore`:
  - Renamed Dockerfile from `Dockerfile-gpu` to `Dockerfile-cuda128` in ignore list.
  - Removed the extra newline for cleaner format.

- Updated GitHub Actions workflows:
  - Modified `main-cuda-docker.yml`, `nightly-cuda-docker.yml` to change Dockerfile reference from `Dockerfile-gpu` to `Dockerfile-cuda128`.
  - Updated image tags from `-gpu` to `-cuda128`.
  - Removed build and verification steps for non-CUDA Docker images from `main-docker.yml` and `nightly-docker.yml`.

- Updated main `Dockerfile`:
  - Adjusted installation steps for Node.js dependencies.
  - Added removal of `.env` file post-build to keep images clean.

- Updated `README.md` for GPU image build command:
  - Changed reference from `Dockerfile-gpu` to `Dockerfile-cuda128`.

- Modified `docker-compose.gpu.yml` and `docker-compose.yml`:
  - Updated Dockerfile reference in `docker-compose.gpu.yml` from `Dockerfile-gpu` to `Dockerfile-cuda128`.
  - Set default paths for `MODELS_DIR`, `WORK_DIR`, and `AUDIO_DIR` using environment variables and adjusted volume configurations.

- Refactored `docker-entrypoint.sh`:
  - Changed virtual environment directory from `/app/deps/` to `/scriberr/`.
  - Removed the dependency check marker file logic for a more direct installation approach.

- Updated `.gitignore` and `env.example`:
  - Removed `*.env` entry from `.gitignore`.
  - Added descriptions for paths in `env.example` for clarity.

These changes streamline the Docker setup, improve environment variable handling, and update documentation for clearer instructions.
2025-02-28 13:47:24 +05:30

61 lines
1.5 KiB
Docker

# 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
COPY env.example .env
# 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
RUN rm .env
# Define default command
CMD ["./docker-entrypoint.sh"]