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.

76 lines
2.1 KiB

  1. FROM ubuntu:20.04
  2. LABEL maintainer="Drew Short <warrick@sothr.com>" \
  3. name="acm" \
  4. version="1.5.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. # https://packages.ubuntu.com/search?suite=focal&section=all&arch=any&keywords=curl&searchon=names
  10. RUN ln -fs /usr/share/zoneinfo/UCT /etc/localtime \
  11. && apt-get update -y \
  12. && apt-get install -f -y --no-install-recommends \
  13. build-essential=12.8ubuntu1 \
  14. curl=7.68.0-1ubuntu2.7 \
  15. ffmpeg=7:4.2.4-1ubuntu0.1 \
  16. opus-tools=0.1.10-1 \
  17. optipng=0.7.7-1 \
  18. python-pip-whl=20.0.2-5ubuntu1.5 \
  19. python3=3.8.2-0ubuntu2 \
  20. python3-pip=20.0.2-5ubuntu1.5 \
  21. python3-distutils=3.8.10-0ubuntu1~20.04 \
  22. python3-apt=2.0.0ubuntu0.20.04.3 \
  23. tzdata=2021e-0ubuntu0.20.04 \
  24. webp=0.6.1-2ubuntu0.20.04.1 \
  25. && apt-get upgrade -y
  26. WORKDIR /tmp
  27. # Install mozjpeg
  28. ARG MOZJPEG_VERSION="3.3.1"
  29. ARG MOZJPEG_ARCH="amd64"
  30. RUN curl -LS -o mozjpeg.deb "https://nexus.nulloctet.com/repository/public/mozjpeg/mozjpeg_${MOZJPEG_VERSION}_${MOZJPEG_ARCH}.deb" \
  31. && dpkg -i mozjpeg.deb \
  32. && ln -sf /opt/mozjpeg/bin/cjpeg /bin/cjpeg \
  33. && rm -f mozjpeg.deb
  34. # Install poetry
  35. ARG POETRY_VERSION="1.1.12"
  36. RUN curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/${POETRY_VERSION}/get-poetry.py" | python3 -
  37. ENV PATH="${PATH}:/root/.poetry/bin"
  38. RUN poetry config virtualenvs.create false
  39. WORKDIR /app
  40. # Copy application
  41. COPY . /app/
  42. # Install application requirements
  43. RUN poetry install
  44. # Cleanup image programs and cache
  45. RUN apt-get remove -y \
  46. build-essential \
  47. curl \
  48. python3-pip \
  49. && rm -rf /var/lib/apt/lists/*
  50. WORKDIR /bin
  51. # Copy application helper script
  52. RUN mv /app/docker/acm acm
  53. # Make script executable
  54. RUN chmod +x acm
  55. VOLUME ["/input", "/output"]
  56. WORKDIR /app
  57. RUN mv docker/* . \
  58. && rm -rf docker \
  59. && mv acm-config.json.example acm-config.json
  60. CMD ["sh", "-c", "find /input/ -type f | /app/entrypoint.sh --stdin --remove-prefix /input/ compress -p default -d /output/"]