add kindlegen, update node, more robust Dockerfile

This commit is contained in:
daniel-j
2023-12-05 21:01:31 +01:00
parent 5dccfbeeec
commit 366282b460
3 changed files with 24 additions and 11 deletions

3
.dockerignore Normal file
View File

@@ -0,0 +1,3 @@
.git
/uploads
/node_modules

View File

@@ -1,19 +1,29 @@
FROM node:16 FROM node:20
# Create app directory # Create app directory
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Copy app files (see .dockerignore)
COPY . ./
# Install app dependencies # Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied RUN npm install --omit=dev
# where available (npm@5+)
COPY package*.json ./
# Download, and prepare the kepubify binary # Download and install kepubify
RUN wget https://github.com/pgaskin/kepubify/releases/download/v4.0.4/kepubify-linux-64bit RUN wget https://github.com/pgaskin/kepubify/releases/download/v4.0.4/kepubify-linux-64bit && \
RUN mv kepubify-linux-64bit /usr/local/bin/kepubify mv kepubify-linux-64bit /usr/local/bin/kepubify && \
RUN chmod +x /usr/local/bin/kepubify chmod +x /usr/local/bin/kepubify
COPY . . # 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
# Create uploads directory if it doesn't exist
RUN mkdir uploads
EXPOSE 3001 EXPOSE 3001
CMD [ "node", "index" ] CMD [ "npm", "start" ]

View File

@@ -4,6 +4,6 @@ services:
build: build:
context: . context: .
dockerfile: ./Dockerfile dockerfile: ./Dockerfile
container_name: send3ereader container_name: send2ereader
ports: ports:
- 3001:3001 - 3001:3001