From 6a6ad6510ed666ccf7794daa5695348c1b492903 Mon Sep 17 00:00:00 2001 From: Richard Roberson Date: Tue, 4 Feb 2025 22:31:35 -0700 Subject: [PATCH] add Docker support --- Dockerfile | 23 +++++++++++++++++++++++ README.md | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e04a168 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Use Node.js slim image +FROM node:slim + +# Create app directory +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy project files +COPY . . + +# Build the Next.js application +RUN npm run build + +# Expose the port the app runs on +EXPOSE 3003 + +# Start the application +CMD ["npm", "start"] \ No newline at end of file diff --git a/README.md b/README.md index 0f1ad93..e38d56c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,26 @@ OpenReader WebUI is a sleek, web-based PDF reader with built-in Text-to-Speech c https://github.com/user-attachments/assets/323251e6-3b3b-43cc-b139-cdab01ca7d75 -## Installation +## 🐳 Docker Quick Start + +```bash +docker run --name openreader-webui -p 3003:3003 richardr1126/openreader-webui:latest +``` +Visit [http://localhost:3003](http://localhost:3003) to run the app. + +### Using Docker Compose +Create or add to a `docker-compose.yml`: +```yaml +services: + openreader-webui: + container_name: openreader-webui + image: richardr1126/openreader-webui:latest + ports: + - "3003:3003" + restart: unless-stopped +``` + +## Dev Installation ### Prerequisites - Node.js & npm (recommended: use [nvm](https://github.com/nvm-sh/nvm)) @@ -48,7 +67,21 @@ https://github.com/user-attachments/assets/323251e6-3b3b-43cc-b139-cdab01ca7d75 ```bash npm run dev ``` - Visit [http://localhost:3000](http://localhost:3000) to run the app. + + or build and run the production server: + ```bash + npm run build + npm start + ``` + + Visit [http://localhost:3003](http://localhost:3003) to run the app. + + > Dev server runs on port 3000 by default, while the production server runs on port 3003. + +#### Docker Supported Architectures +- linux/amd64 (x86_64) +- linux/arm64 (Apple Silicon) +- linux/arm/v7 (Raspberry Pi) ## **Features** - Real-time sentence by sentence text-to-speech via OpenAI API TTS, [Kokoro FastAPI TTS](https://github.com/remsky/Kokoro-FastAPI), or others compatible with the `/v1/audio/speech` endpoint