Dockerfile 1.1 KB

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