This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
52 lines (43 loc) · 1.58 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# build environment
FROM --platform=$BUILDPLATFORM node:14.11.0-alpine3.12 as build-stage
RUN mkdir /app && chown -R node:node /app
WORKDIR /app
RUN apk add --no-cache python3 make g++
USER node
COPY --chown=node:node package*.json ./
RUN SKIP_BUILD=true npm ci
COPY --chown=node:node . .
ARG VERSION
ARG REVISION
RUN npm run build
# dependency environment
FROM node:14.13.1-alpine3.12 as dependency-stage
RUN mkdir /app && chown -R node:node /app
WORKDIR /app
RUN apk add --no-cache python3 make g++
USER node
COPY --chown=node:node package*.json ./
RUN SKIP_BUILD=true npm ci
RUN npm prune --production
# production environment
FROM node:14.13.1-alpine3.12 as production-stage
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.source="https://github.com/ttshivers/synclounge"
LABEL org.opencontainers.image.vendor="SyncLounge"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.documentation="https://docs.synclounge.tv"
RUN mkdir /app && chown -R node:node /app
WORKDIR /app
COPY --chown=node:node server.js .
COPY --chown=node:node config config
COPY --chown=node:node --from=dependency-stage /app/node_modules node_modules
COPY --chown=node:node --from=build-stage /app/dist dist
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
ENTRYPOINT ["/app/server.js"]