-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 922 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (30 loc) · 922 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
30
31
32
33
34
35
36
37
38
39
40
FROM python:3.12-slim
LABEL maintainer="LogWatch" \
description="DevOps Log Monitoring Tool" \
version="1.0.0"
# Install cron
RUN apt-get update && apt-get install -y --no-install-recommends cron \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application source
COPY logwatch/ ./logwatch/
COPY config/ ./config/
COPY setup.py .
# Install the package
RUN pip install --no-cache-dir -e .
# Copy cron and scripts
COPY crontab /etc/cron.d/logwatch-cron
COPY scripts/ ./scripts/
COPY scripts/entrypoint.sh /entrypoint.sh
# Set permissions
RUN chmod 0644 /etc/cron.d/logwatch-cron \
&& chmod +x /entrypoint.sh \
&& mkdir -p /logs /reports
# Create log file for cron output
RUN touch /var/log/cron.log
ENTRYPOINT ["/entrypoint.sh"]
CMD ["cron"]