-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (27 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
41 lines (27 loc) · 1.09 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
# Stage 1: Build the webui
FROM node:20-slim AS webui-builder
WORKDIR /build
# Copy webui files
COPY webui/package*.json ./
RUN npm ci
COPY webui/ ./
RUN npm run build
# Stage 2: Python application
FROM python:3.11-slim-bookworm
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# 1. Copy the 'cogs' folder (Required for the bot to find extensions)
COPY cogs/ ./cogs/
# 2. Copy utility scripts (Matches docker_utils.py, plex_utils.py, etc.)
# This pattern excludes the redundant *_functions.py files
COPY *_utils.py ./
# 3. Copy database and notification modules
COPY notification_db.py ./
# 4. Copy the main bot application files
COPY bot.py config.py utils.py media_watcher_service.py rate_limit.py request_utils.py __init__.py ./
# 5. Copy the built webui from the builder stage
COPY --from=webui-builder /build/dist ./webui/dist
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5000/api/health', timeout=5)" || exit 1
CMD ["python", "bot.py"]