audiobookshelf/Dockerfile

41 lines
806 B
Docker
Raw Normal View History

### STAGE 0: Build client ###
FROM node:16-alpine AS build
2021-08-18 00:01:11 +02:00
WORKDIR /client
COPY /client /client
RUN npm ci && npm cache clean --force
2021-08-18 00:01:11 +02:00
RUN npm run generate
### STAGE 1: Build server ###
FROM sandreas/tone:v0.1.5 AS tone
FROM node:16-alpine
2021-08-18 00:01:11 +02:00
ENV NODE_ENV=production
RUN apk update && \
apk add --no-cache --update \
curl \
tzdata \
ffmpeg \
make \
python3 \
g++
COPY --from=tone /usr/local/bin/tone /usr/local/bin/
2021-08-18 00:01:11 +02:00
COPY --from=build /client/dist /client/dist
COPY index.js package* /
2021-08-18 00:01:11 +02:00
COPY server server
RUN npm ci --only=production
RUN apk del make python3 g++
2023-07-17 23:48:46 +02:00
ENV NODE_OPTIONS=--max-old-space-size=8192
2021-08-18 00:01:11 +02:00
EXPOSE 80
HEALTHCHECK \
--interval=30s \
--timeout=3s \
--start-period=10s \
CMD curl -f http://127.0.0.1/healthcheck || exit 1
CMD ["node", "index.js"]