diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0d16104 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +/uploads +/node_modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1178eef --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM node:20 + +# Create app directory +WORKDIR /usr/src/app + +# Copy files needed by npm install +COPY package*.json ./ + +# Install app dependencies +RUN npm install --omit=dev + +# Download and install kepubify +RUN wget https://github.com/pgaskin/kepubify/releases/download/v4.0.4/kepubify-linux-64bit && \ + mv kepubify-linux-64bit /usr/local/bin/kepubify && \ + chmod +x /usr/local/bin/kepubify + +# Download and install kindlegen +RUN wget https://archive.org/download/kindlegen2.9/kindlegen_linux_2.6_i386_v2_9.tar.gz && \ + mkdir kindlegen && \ + tar xvf kindlegen_linux_2.6_i386_v2_9.tar.gz --directory kindlegen && \ + cp kindlegen/kindlegen /usr/local/bin/kindlegen && \ + chmod +x /usr/local/bin/kindlegen && \ + rm -rf kindlegen + +# Copy the rest of the app files (see .dockerignore) +COPY . ./ + +# Create uploads directory if it doesn't exist +RUN mkdir uploads + +EXPOSE 3001 +CMD [ "npm", "start" ] diff --git a/README.md b/README.md new file mode 100644 index 0000000..27377a3 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# send2ereader + +A self hostable service for sending ebooks to a Kobo or Kindle ereader through the built-in browser. + +## How To Run + +### On Your Host OS + +1. Have Node.js 16 or 20 installed +2. Install this service's dependencies by running `$ npm install` +3. Install [Kepubify](https://github.com/pgaskin/kepubify), and have the kepubify executable in your PATH. +4. Install [KindleGen](https://archive.org/details/kindlegen2.9), and have the kindlegen executable in your PATH. +5. Start this service by running: `$ npm start` and access it on HTTP port 3001 + +### Containerized + +1. Have Docker installed +2. Run `$ docker compose up` +3. Access the service on HTTP port 3001 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..6b1a111 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +version: "3" +services: + send2ereader: + build: + context: . + dockerfile: ./Dockerfile + container_name: send2ereader + ports: + - 3001:3001 diff --git a/download.html b/download.html index eed5355..7daf0a5 100644 --- a/download.html +++ b/download.html @@ -4,7 +4,7 @@