mirror of
https://github.com/aserper/masto-rss.git
synced 2025-12-17 05:15:25 +00:00
Changes: - Add -u flag to Python in Dockerfile to disable output buffering - Add startup messages in main.py showing bot configuration - Logs now appear immediately in kubectl logs output This fixes the issue where no logs were visible when running in Kubernetes pods due to Python's default stdout buffering.
19 lines
493 B
Docker
19 lines
493 B
Docker
# Use an appropriate base image with Python pre-installed
|
|
FROM alpine:3.18
|
|
|
|
# Set the working directory inside the container
|
|
WORKDIR /app
|
|
|
|
# Install Python dependencies in a single layer
|
|
RUN apk add --no-cache python3 py3-pip
|
|
|
|
# Copy requirements first for better layer caching
|
|
COPY requirements.txt /app/
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the application code
|
|
COPY . /app
|
|
|
|
# Run Python script with unbuffered output for container logs
|
|
CMD ["python", "-u", "main.py"]
|