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.

79 lines
2.2 KiB

  1. FROM ubuntu:20.04
  2. LABEL maintainer="Drew Short <warrick@sothr.com>" \
  3. name="acm" \
  4. version="2.0.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. # Install application requirements
  41. COPY pyproject.toml poetry.lock /app/
  42. RUN poetry install
  43. # Cleanup image programs and cache
  44. RUN apt-get remove -y \
  45. build-essential \
  46. curl \
  47. python3-pip \
  48. && rm -rf /var/lib/apt/lists/* \
  49. && rm -rf /tmp/*
  50. # Copy application
  51. COPY . /app/
  52. WORKDIR /bin
  53. # Copy application helper script
  54. RUN mv /app/docker/acm acm
  55. # Make script executable
  56. RUN chmod +x acm
  57. VOLUME ["/input", "/output"]
  58. WORKDIR /app
  59. RUN mv docker/* . \
  60. && chmod +x entrypoint.sh \
  61. && rm -rf docker \
  62. && mv acm-config.json.example acm-config.json
  63. CMD ["sh", "-c", "find /input/ -type f | /app/entrypoint.sh --stdin --remove-prefix /input/ compress -p default -d /output/"]