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

View File

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