| 12345678910111213141516171819202122232425262728293031323334353637 |
- FROM python:3.12-slim
- # 1. Install system dependencies
- RUN apt-get update && apt-get install -y --no-install-recommends \
- curl \
- && rm -rf /var/lib/apt/lists/*
- # 2. Install Python deps
- RUN pip install --upgrade pip
- RUN pip install --no-cache-dir pyyaml
- # 3. Install Supercronic
- ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.29/supercronic-linux-amd64 \
- SUPERCRONIC=supercronic-linux-amd64 \
- SUPERCRONIC_SHA1SUM=cd48d45c4b10f3f0bfdd3a57d054cd05ac96812b
- RUN curl -fsSLO "$SUPERCRONIC_URL" \
- && echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
- && chmod +x "$SUPERCRONIC" \
- && mv "$SUPERCRONIC" /usr/local/bin/supercronic
- # 4. Setup App Logic
- WORKDIR /app
- COPY manager.py /app/manager.py
- COPY log_formatter.py /app/log_formatter.py
- # 5. Setup Defaults
- # We create a separate folder to hold the "template" files
- RUN mkdir /app/defaults
- COPY defaults/config.yaml /app/defaults/config.yaml
- COPY defaults/hello_world.py /app/defaults/hello_world.py
- # 6. Prepare the mount point
- RUN mkdir /scripts
- VOLUME ["/scripts"]
- ENTRYPOINT ["python3", "-u", "/app/manager.py"]
|