dockerize!

This commit is contained in:
Matteo Rosati
2026-01-14 23:54:51 +01:00
parent 1e76403565
commit 46ddcc16da
14 changed files with 1362 additions and 18 deletions

41
Dockerfile-schedule Normal file
View File

@@ -0,0 +1,41 @@
# Use Python slim image as base
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Copy requirements.txt first to leverage Docker cache
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# System packages
RUN apt update && apt install -y tzdata
# Timezone
ENV TZ=Europe/Rome
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Copy application files
COPY schedule.py .
# Copy entrypoint script and make it executable
COPY entrypoint-schedule.sh .
RUN chmod +x entrypoint-schedule.sh
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Required environment variables for schedule.py
# These can be overridden at runtime using -e or --env-file
# ENDPOINT_URL: The API endpoint to fetch plexts from
ENV ENDPOINT_URL=""
# MONGO_URI: MongoDB connection string
ENV MONGO_URI=""
# DB_NAME: MongoDB database name
ENV COLLECTION_NAME=""
# Run the schedule script using the entrypoint script
# Using JSON array form for proper signal handling
CMD ["./entrypoint-schedule.sh"]