Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (49 loc) · 1.97 KB
/
Copy pathDockerfile
File metadata and controls
67 lines (49 loc) · 1.97 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Build stage
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Production stage
FROM node:22-alpine
WORKDIR /app
RUN apk add --no-cache chromium python3
ARG VERSION
ARG REVISION
ARG CREATED
ARG DESCRIPTION
ARG SOURCE
LABEL org.opencontainers.image.title="CinePro Core" \
org.opencontainers.image.description="${DESCRIPTION}" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${REVISION}" \
org.opencontainers.image.created="${CREATED}" \
org.opencontainers.image.source="${SOURCE}"
LABEL org.opencontainers.image.description="CinePro Core is the central scraping and streaming engine of the CinePro ecosystem. It exposes an OMSS-compliant HTTP API for resolving movie and TV show streams from multiple providers."
ARG NODE_ENV=production
ARG PORT=3000
ARG CACHE_TYPE=memory
ENV NODE_ENV=${NODE_ENV}
ENV HOST=0.0.0.0
ENV PORT=${PORT}
ENV CACHE_TYPE=${CACHE_TYPE}
ENV DADDYLIVE_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium-browser
COPY package*.json ./
COPY scripts/patch-framework-ranges.mjs ./scripts/patch-framework-ranges.mjs
RUN npm ci --only=production && node scripts/patch-framework-ranges.mjs
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/config ./config
# Release managers may stage the Git worktree with a restrictive umask (077),
# so copied files can arrive as 0600 root. Keep the runtime image non-root
# while making everything the runtime reads traversable and readable for the
# nodejs user regardless of the source checkout's host-side modes: the compiled
# code and its provider assets (the WCO provider runs
# dist/providers/wco/public-page.py), static configuration, the scripts and
# package.json (Node reads it to resolve the module type).
RUN chmod -R a+rX ./dist ./config ./scripts package.json package-lock.json
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
USER nodejs
EXPOSE ${PORT}
CMD ["node", "dist/server.js"]