-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile.iptv-worker
More file actions
29 lines (20 loc) · 903 Bytes
/
Dockerfile.iptv-worker
File metadata and controls
29 lines (20 loc) · 903 Bytes
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
# IPTV Cache Worker Dockerfile
# Lightweight container for background IPTV playlist caching
FROM node:22-alpine
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install all dependencies (need dev deps for tsx)
RUN pnpm install --frozen-lockfile
# Copy worker source files
COPY workers ./workers
COPY src/lib/iptv ./src/lib/iptv
COPY tsconfig.json ./
# Set environment
ENV NODE_ENV=production
# Health check - verify worker is running by checking Redis status key
HEALTHCHECK --interval=60s --timeout=10s --start-period=30s --retries=3 \
CMD node -e "const Redis = require('ioredis'); const r = new Redis(process.env.REDIS_URL); r.get('iptv:worker:last_run').then(v => process.exit(v && Date.now() - parseInt(v) < 1200000 ? 0 : 1)).catch(() => process.exit(1))"
# Run the worker
CMD ["pnpm", "iptv-worker"]