audiobookshelf/Dockerfile

33 lines
692 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.0.9 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
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
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
2021-08-18 00:01:11 +02:00
CMD ["npm", "start"]