-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (44 loc) · 1.44 KB
/
Dockerfile
File metadata and controls
60 lines (44 loc) · 1.44 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
# Stage 1: Build production dependencies
FROM node:20-alpine AS deps
WORKDIR /build
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --omit=dev
# Stage 2: Final production image
FROM node:20-alpine
# Add metadata labels
LABEL org.opencontainers.image.source="https://github.com/cbulock/iptv-proxy"
LABEL org.opencontainers.image.description="IPTV Proxy - Unified Channel and EPG Aggregator"
LABEL org.opencontainers.image.licenses="MIT"
# Install ffmpeg for server-side transcoding of MPEG-TS streams
# (converts MPEG-2/AC-3 from HDHomeRun to H.264/AAC for browser playback)
RUN apk add --no-cache ffmpeg
# Create app directory
WORKDIR /usr/src/app
# Copy production dependencies
COPY --from=deps /build/node_modules ./node_modules
# Copy application files
COPY package*.json ./
COPY index.js ./
COPY libs ./libs
COPY scripts ./scripts
COPY server ./server
COPY public ./public
# Copy healthcheck
COPY healthcheck.sh ./
RUN chmod +x /usr/src/app/healthcheck.sh
# Create mounted volume directories with world-writable permissions
RUN mkdir -p /config /data && \
chmod 777 /config /data
# Set config and data directory paths
ENV CONFIG_PATH=/config
ENV DATA_PATH=/data
VOLUME ["/config", "/data"]
# Expose application port
EXPOSE 34400
# Add healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD /bin/sh /usr/src/app/healthcheck.sh
# Run the application
CMD ["node", "index.js"]