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.

65 lines
1.6 KiB

  1. FROM ubuntu:20.04
  2. LABEL maintainer="Drew Short <warrick@sothr.com>" \
  3. name="acm" \
  4. version="1.4.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. # Install tooling (ffmpeg, opusenc, optipng, python3)
  10. RUN ln -fs /usr/share/zoneinfo/UCT /etc/localtime \
  11. && apt-get update -y \
  12. && apt-get install -y --fix-missing \
  13. curl \
  14. ffmpeg \
  15. opus-tools \
  16. optipng \
  17. python3 \
  18. python3-pip \
  19. tzdata \
  20. webp
  21. WORKDIR /tmp
  22. # Install mozjpeg
  23. ARG MOZJPEG_VERSION="3.3.1"
  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. # Install poetry
  29. ARG POETRY_VERSION="1.1.12"
  30. RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/${POETRY_VERSION}/get-poetry.py | python -
  31. # Cleanup image programs and cache
  32. RUN apt-get remove -y curl \
  33. && rm -rf /var/lib/apt/lists/*
  34. WORKDIR /app
  35. # Copy application
  36. COPY acm-config-default.json acm.py requirements.txt /app/
  37. # Install application requirements
  38. RUN python3 -m pip install -r requirements.txt
  39. WORKDIR /bin
  40. # Copy application helper script
  41. COPY docker/acm acm
  42. # Make script executable
  43. RUN chmod +x acm
  44. VOLUME ["/input", "/output"]
  45. WORKDIR /app
  46. COPY acm-config.json.example acm-config.json
  47. COPY docker/entrypoint.sh .
  48. CMD ["sh", "-c", "find /input/ -type f | /app/entrypoint.sh --stdin --remove-prefix /input/ compress -p default -d /output/"]