Tooling for managing asset compression, storage, and retrieval
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.4 KiB

  1. FROM ubuntu:20.04
  2. LABEL maintainer="Drew Short <warrick@sothr.com>" \
  3. name="acm" \
  4. version="1.2.0" \
  5. description="Prepackaged ACM with defaults and tooling"
  6. ENV LC_ALL=C.UTF-8
  7. ENV LANG=C.UTF-8
  8. ENV DEBIAN_FRONTEND=noninteractive
  9. ARG MOZJPEG_VERSION="3.3.1"
  10. # Install tooling (ffmpeg, opusenc, optipng, python3)
  11. RUN ln -fs /usr/share/zoneinfo/UCT /etc/localtime \
  12. && apt-get update -y \
  13. && apt-get install -y --fix-missing \
  14. curl \
  15. ffmpeg \
  16. opus-tools \
  17. optipng \
  18. python3 \
  19. python3-pip \
  20. tzdata \
  21. webp
  22. WORKDIR /tmp
  23. # Install mozjpeg
  24. RUN curl -LS -o mozjpeg.deb "https://nexus.nulloctet.com/repository/public/mozjpeg/mozjpeg_${MOZJPEG_VERSION}_amd64.deb" \
  25. && dpkg -i mozjpeg.deb \
  26. && ln -sf /opt/mozjpeg/bin/cjpeg /bin/cjpeg \
  27. && rm -f mozjpeg.deb
  28. # Cleanup image programs and cache
  29. RUN apt-get remove -y curl \
  30. && rm -rf /var/lib/apt/lists/*
  31. WORKDIR /app
  32. # Copy application
  33. COPY acm-config-default.json acm.py requirements.txt /app/
  34. # Install application requirements
  35. RUN python3 -m pip install -r requirements.txt
  36. WORKDIR /bin
  37. # Copy application helper script
  38. COPY docker/acm acm
  39. # Make script executable
  40. RUN chmod +x acm
  41. VOLUME ["/input", "/output"]
  42. WORKDIR /app
  43. COPY acm-config.json.example acm-config.json
  44. COPY docker/entrypoint.sh .
  45. CMD ["sh", "-c", "find /input/ -type f | /app/entrypoint.sh --stdin --remove-prefix /input/ compress -p default -d /output/"]