2020-08-14 23:13:34 +00:00
|
|
|
# build environment
|
2020-10-11 20:31:07 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM node:14.13.1-alpine3.12 as build-stage
|
2020-08-24 01:08:44 +00:00
|
|
|
RUN mkdir /app && chown -R node:node /app
|
2020-08-14 23:13:34 +00:00
|
|
|
WORKDIR /app
|
2020-09-19 20:14:33 +00:00
|
|
|
RUN apk add --no-cache python3 make g++
|
2020-09-01 00:05:56 +00:00
|
|
|
USER node
|
2020-08-24 01:08:44 +00:00
|
|
|
COPY --chown=node:node package*.json ./
|
2020-08-31 22:55:14 +00:00
|
|
|
RUN SKIP_BUILD=true npm ci
|
2020-08-24 01:08:44 +00:00
|
|
|
COPY --chown=node:node . .
|
2020-08-14 23:13:34 +00:00
|
|
|
|
2020-08-27 23:22:46 +00:00
|
|
|
ARG SERVERS
|
2020-08-30 20:05:37 +00:00
|
|
|
ARG VERSION
|
2020-08-14 23:13:34 +00:00
|
|
|
ARG REVISION
|
|
|
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
# production environment
|
2020-10-06 02:28:58 +00:00
|
|
|
FROM nginx:1.19.3-alpine as production-stage
|
2020-08-14 23:13:34 +00:00
|
|
|
LABEL org.opencontainers.image.title="SyncLounge Web"
|
|
|
|
LABEL org.opencontainers.image.description="Enjoy Plex with your friends. In Sync. Together."
|
2020-09-28 06:13:54 +00:00
|
|
|
LABEL org.opencontainers.image.url="https://synclounge.tv"
|
2020-10-08 23:53:16 +00:00
|
|
|
LABEL org.opencontainers.image.source="https://github.com/synclounge/synclounge"
|
2020-08-14 23:13:34 +00:00
|
|
|
LABEL org.opencontainers.image.vendor="SyncLounge"
|
|
|
|
LABEL org.opencontainers.image.licenses="MIT"
|
2020-09-28 06:13:54 +00:00
|
|
|
LABEL org.opencontainers.image.documentation="https://docs.synclounge.tv"
|
2020-08-24 01:08:44 +00:00
|
|
|
|
|
|
|
COPY --chown=nginx:nginx --from=build-stage /app/dist /usr/share/nginx/html
|
|
|
|
|
|
|
|
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
|