24 lines
685 B
Docker
24 lines
685 B
Docker
FROM --platform=$TARGETPLATFORM python:3.12-slim-bookworm
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_NO_CACHE_DIR=1
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Python dependencies first to leverage layer caching.
|
|
COPY requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application source.
|
|
COPY jira_jotty_sync.py ./
|
|
COPY sync_config.json.template ./
|
|
|
|
# Run as non-root for better container security.
|
|
RUN useradd --create-home --uid 10001 appuser && chown -R appuser:appuser /app
|
|
USER appuser
|
|
|
|
# Run every 5 minutes via cron
|
|
CMD echo "*/5 * * * * cd /app && python jira_jotty_sync.py --direction both >> /tmp/sync.log 2>&1" | crontab - && \
|
|
crond -f
|