Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. FROM python:3.10-slim
  2. WORKDIR /app
  3. # https://github.com/aptible/supercronic/releases
  4. ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.34/supercronic-linux-amd64 \
  5. SUPERCRONIC_SHA1SUM=e8631edc1775000d119b70fd40339a7238eece14 \
  6. SUPERCRONIC=supercronic-linux-amd64
  7. RUN apt-get update && \
  8. apt-get install -y --no-install-recommends curl && \
  9. curl -fsSLO "$SUPERCRONIC_URL" && \
  10. echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
  11. chmod +x "$SUPERCRONIC" && \
  12. mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
  13. ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic && \
  14. apt-get remove -y curl && \
  15. apt-get clean && \
  16. rm -rf /var/lib/apt/lists/*
  17. COPY requirements.txt .
  18. RUN pip install --no-cache-dir -r requirements.txt
  19. COPY main.py .
  20. COPY docker/manage.py .
  21. COPY docker/entrypoint.sh /entrypoint.sh
  22. RUN chmod +x /entrypoint.sh && \
  23. chmod +x manage.py && \
  24. mkdir -p /app/config /app/output
  25. ENV PYTHONUNBUFFERED=1 \
  26. CONFIG_PATH=/app/config/config.yaml \
  27. FREQUENCY_WORDS_PATH=/app/config/frequency_words.txt
  28. ENTRYPOINT ["/entrypoint.sh"]