Custom base path (fix #3874, related to #3535)

This commit is contained in:
Dashamir Hoxha 2025-11-02 15:21:30 +01:00 committed by GitHub
parent 0c7b738b7c
commit b20a317c6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,4 @@
ARG BASE_PATH=""
ARG NUSQLITE3_DIR="/usr/local/lib/nusqlite3" ARG NUSQLITE3_DIR="/usr/local/lib/nusqlite3"
ARG NUSQLITE3_PATH="${NUSQLITE3_DIR}/libnusqlite3.so" ARG NUSQLITE3_PATH="${NUSQLITE3_DIR}/libnusqlite3.so"
@ -6,6 +7,7 @@ FROM node:20-alpine AS build-client
WORKDIR /client WORKDIR /client
COPY /client /client COPY /client /client
ENV ROUTER_BASE_PATH=${BASE_PATH}
RUN npm ci && npm cache clean --force RUN npm ci && npm cache clean --force
RUN npm run generate RUN npm run generate
@ -38,6 +40,7 @@ RUN case "$TARGETPLATFORM" in \
unzip /tmp/library.zip -d $NUSQLITE3_DIR && \ unzip /tmp/library.zip -d $NUSQLITE3_DIR && \
rm /tmp/library.zip rm /tmp/library.zip
ENV ROUTER_BASE_PATH=${BASE_PATH}
RUN npm ci --only=production RUN npm ci --only=production
### STAGE 2: Create minimal runtime image ### ### STAGE 2: Create minimal runtime image ###
@ -61,6 +64,7 @@ COPY --from=build-server ${NUSQLITE3_PATH} ${NUSQLITE3_PATH}
EXPOSE 80 EXPOSE 80
ENV ROUTER_BASE_PATH=${BASE_PATH}
ENV PORT=80 ENV PORT=80
ENV NODE_ENV=production ENV NODE_ENV=production
ENV CONFIG_PATH="/config" ENV CONFIG_PATH="/config"

View File

@ -1,7 +1,11 @@
### EXAMPLE DOCKER COMPOSE ### ### EXAMPLE DOCKER COMPOSE ###
services: services:
audiobookshelf: audiobookshelf:
image: ghcr.io/advplyr/audiobookshelf:latest image: audiobookshelf
build:
context: .
#args:
# BASE_PATH: /audiobooks
# ABS runs on port 13378 by default. If you want to change # ABS runs on port 13378 by default. If you want to change
# the port, only change the external port, not the internal port # the port, only change the external port, not the internal port
ports: ports: