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-08-24 01:08:44 +00:00
|
|
|
RUN mkdir /app && chown -R node:node /app
|
2020-07-21 00:01:07 +00:00
|
|
|
WORKDIR /app
|
2020-08-24 01:08:44 +00:00
|
|
|
COPY --chown=node:node package*.json ./
|
2020-07-27 20:06:36 +00:00
|
|
|
RUN npm ci
|
2020-08-24 01:08:44 +00:00
|
|
|
COPY --chown=node:node . .
|
2020-07-21 02:27:43 +00:00
|
|
|
|
2020-08-30 20:05:37 +00:00
|
|
|
ARG VERSION
|
2020-07-24 21:25:45 +00:00
|
|
|
ARG REVISION
|
|
|
|
|
2020-07-21 00:01:07 +00:00
|
|
|
RUN npm run build
|
|
|
|
|
2020-08-24 01:26:06 +00:00
|
|
|
# dependency environment
|
|
|
|
FROM node:current-alpine as dependency-stage
|
|
|
|
RUN mkdir /app && chown -R node:node /app
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache python make g++
|
|
|
|
USER node
|
|
|
|
COPY --chown=node:node package*.json ./
|
|
|
|
RUN npm ci --only=production
|
2020-08-24 01:08:44 +00:00
|
|
|
|
2020-07-23 23:40:45 +00:00
|
|
|
# production environment
|
2020-08-21 01:47:45 +00:00
|
|
|
FROM node:current-alpine as production-stage
|
2020-07-24 23:44:38 +00:00
|
|
|
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/"
|
2020-08-28 00:35:21 +00:00
|
|
|
LABEL org.opencontainers.image.source="https://github.com/ttshivers/syncloungesocket"
|
2020-07-24 23:44:38 +00:00
|
|
|
LABEL org.opencontainers.image.vendor="SyncLounge"
|
|
|
|
LABEL org.opencontainers.image.licenses="MIT"
|
|
|
|
LABEL org.opencontainers.image.documentation="https://docs.synclounge.tv/"
|
|
|
|
|
2020-08-24 01:08:44 +00:00
|
|
|
RUN mkdir /app && chown -R node:node /app
|
2020-08-21 01:32:23 +00:00
|
|
|
WORKDIR /app
|
2020-08-24 01:08:44 +00:00
|
|
|
COPY --chown=node:node server.js .
|
|
|
|
COPY --chown=node:node config config
|
2020-08-24 01:26:06 +00:00
|
|
|
COPY --chown=node:node --from=dependency-stage /app/node_modules node_modules
|
2020-08-24 01:08:44 +00:00
|
|
|
COPY --chown=node:node --from=build-stage /app/dist dist
|
2020-08-21 01:32:23 +00:00
|
|
|
|
|
|
|
ARG VERSION
|
|
|
|
LABEL org.opencontainers.image.version=$VERSION
|
|
|
|
|
|
|
|
ARG REVISION
|
|
|
|
LABEL org.opencontainers.image.revision=$REVISION
|
|
|
|
|
|
|
|
ARG BUILD_DATE
|
|
|
|
LABEL org.opencontainers.image.created=$BUILD_DATE
|
|
|
|
|
2020-08-24 01:08:44 +00:00
|
|
|
ENTRYPOINT ["/app/server.js"]
|