synclounge/Dockerfile

45 lines
1.5 KiB
Docker
Raw Normal View History

2020-07-21 00:01:07 +00:00
# build environment
2020-07-24 05:51:47 +00:00
FROM --platform=$BUILDPLATFORM node:current-alpine as build-stage
2020-07-21 00:01:07 +00:00
WORKDIR /app
COPY package*.json ./
2020-07-27 20:06:36 +00:00
RUN npm ci
2020-07-21 00:01:07 +00:00
COPY . .
2020-07-21 02:27:43 +00:00
2020-07-22 00:02:13 +00:00
ARG SERVERS='[{"name":"Local Server","location":"Local","url":"","image":"synclounge-white.png"}]'
2020-07-22 21:38:44 +00:00
ARG SOURCE_BRANCH
2020-07-24 21:25:45 +00:00
ARG REVISION
2020-07-21 00:01:07 +00:00
RUN npm run build
2020-07-23 23:40:45 +00:00
# dependency build environment
FROM node:current-alpine as dependency-stage
2020-07-21 00:01:07 +00:00
WORKDIR /app
2020-07-23 23:40:45 +00:00
## Install build toolchain, install node deps and compile native add-ons
RUN apk add --no-cache python make g++
2020-08-08 00:37:06 +00:00
RUN NPM_CONFIG_PREFIX=/app/.npm-global NPM_CONFIG_CACHE=/home/node/.cache npm install --unsafe-perm -g syncloungesocket@4.0.1 nconf
2020-07-21 21:54:59 +00:00
COPY docker-entrypoint.sh .
2020-07-21 21:28:48 +00:00
COPY config config
2020-07-23 23:40:45 +00:00
# production environment
FROM node:current-alpine as production-stage
WORKDIR /app
COPY --from=dependency-stage /app .
2020-07-27 20:06:36 +00:00
COPY --from=build-stage /app/dist dist
2020-07-24 23:44:38 +00:00
2020-07-25 00:02:48 +00:00
ARG VERSION
2020-07-24 23:44:38 +00:00
ARG REVISION
2020-07-25 00:02:48 +00:00
ARG BUILD_DATE
2020-07-24 23:44:38 +00:00
LABEL org.opencontainers.image.created=$BUILD_DATE
LABEL org.opencontainers.image.title="SyncLounge"
LABEL org.opencontainers.image.description="Enjoy Plex with your friends. In Sync. Together."
LABEL org.opencontainers.image.url="https://synclounge.tv/"
LABEL org.opencontainers.image.revision=$REVISION
LABEL org.opencontainers.image.source="https://github.com/samcm/synclounge"
LABEL org.opencontainers.image.vendor="SyncLounge"
LABEL org.opencontainers.image.version=$VERSION
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.documentation="https://docs.synclounge.tv/"
2020-08-08 16:13:19 +00:00
ENTRYPOINT ["/app/docker-entrypoint.sh"]