Browse Source

Prep work for new container build

acm-debugging-and-enhancements
Drew Short 9 months ago
parent
commit
05c7927305
  1. 9
      .dockerignore
  2. 30
      Dockerfile
  3. 36
      acm-config-default.json
  4. 2
      pyproject.toml
  5. 2
      setup.py
  6. 11
      upload_pipeline.sh

9
.dockerignore

@ -1 +1,8 @@
acm-config.json.example
.git/
.idea/
scripts/
.gitignore
Dockerfile
pipeline.yml

30
Dockerfile

@ -2,25 +2,25 @@ FROM ubuntu:20.04
LABEL maintainer="Drew Short <warrick@sothr.com>" \
name="acm" \
version="1.4.0" \
version="1.5.0" \
description="Prepackaged ACM with defaults and tooling"
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
# Install tooling (ffmpeg, opusenc, optipng, python3)
# https://packages.ubuntu.com/search?suite=focal&section=all&arch=any&keywords=curl&searchon=names
RUN ln -fs /usr/share/zoneinfo/UCT /etc/localtime \
&& apt-get update -y \
&& apt-get install -y --fix-missing \
curl \
ffmpeg \
opus-tools \
optipng \
python3 \
python3-pip \
tzdata \
webp
curl=7.68.0-1ubuntu2.7 \
ffmpeg=7:4.2.4-1ubuntu0.1 \
opus-tools=0.1.10-1 \
optipng=0.7.7-1 \
python3=3.8.2-0ubuntu2 \
python3-pip=20.0.2-5ubuntu1.5 \
tzdata=2021e-0ubuntu0.20.04 \
webp=0.6.1-2ubuntu0.20.04.1
WORKDIR /tmp
@ -42,7 +42,7 @@ RUN apt-get remove -y curl \
WORKDIR /app
# Copy application
COPY acm-config-default.json acm.py requirements.txt /app/
COPY . /app/
# Install application requirements
RUN python3 -m pip install -r requirements.txt
@ -50,16 +50,16 @@ RUN python3 -m pip install -r requirements.txt
WORKDIR /bin
# Copy application helper script
COPY docker/acm acm
RUN mv /app/docker/acm acm
# Make script executable
RUN chmod +x acm
VOLUME ["/input", "/output"]
WORKDIR /app
COPY acm-config.json.example acm-config.json
COPY docker/entrypoint.sh .
RUN mv docker/* . \
&& rm -rf docker \
&& mv acm-config.json.example acm-config.json
CMD ["sh", "-c", "find /input/ -type f | /app/entrypoint.sh --stdin --remove-prefix /input/ compress -p default -d /output/"]

36
acm-config-default.json

@ -3,7 +3,7 @@
"profiles": {
"default": {
"jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"cjpeg"
],
@ -16,7 +16,7 @@
"command": "cjpeg -optimize -quality 90 -progressive -outfile {output_file} {input_file}"
},
"png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"optipng"
],
@ -28,7 +28,7 @@
"command": "optipng -o2 -strip all -out {output_file} {input_file}"
},
"video": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"ffmpeg"
],
@ -40,7 +40,7 @@
"command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -c:v libvpx-vp9 -b:v 0 -crf 29 -c:a libopus {output_file}"
},
"audio": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"ffmpeg",
"opusenc"
@ -55,7 +55,7 @@
},
"placebo": {
"jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"cp"
],
@ -69,7 +69,7 @@
"command": "cp {input_file} {output_file}"
},
"png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"cp"
],
@ -82,7 +82,7 @@
"command": "cp {input_file} {output_file}"
},
"video": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"cp"
],
@ -96,7 +96,7 @@
"command": "cp {input_file} {output_file}"
},
"audio": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"cp"
],
@ -112,7 +112,7 @@
},
"webp": {
"jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"cwebp"
],
@ -124,7 +124,7 @@
"command": "cwebp -jpeg_like -q 90 -o {output_file} {input_file}"
},
"png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"cwebp"
],
@ -137,7 +137,7 @@
},
"aggressive": {
"jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"ffmpeg",
"cjpeg"
@ -151,7 +151,7 @@
"command": "export FILE={output_file} && export TEMP_FILE=${FILE}_tmp.jpg && ffmpeg -i {input_file} -vf scale=-1:720 ${TEMP_FILE} && cjpeg -optimize -quality 75 -progressive -outfile {output_file} ${TEMP_FILE} && rm ${TEMP_FILE}"
},
"png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"optipng"
],
@ -163,7 +163,7 @@
"command": "optipng -o2 -strip all -out {output_file} {input_file}"
},
"video": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"ffmpeg"
],
@ -175,7 +175,7 @@
"command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -vf scale=-1:720 -c:v libvpx-vp9 -b:v 0 -crf 38 -c:a libopus {output_file}"
},
"audio": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"ffmpeg",
"opusenc"
@ -190,7 +190,7 @@
},
"aggressive-webp": {
"jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"cwebp"
],
@ -202,7 +202,7 @@
"command": "export FILE={output_file} && export TEMP_FILE=${FILE}_tmp.jpg && ffmpeg -i {input_file} -vf scale=-1:720 ${TEMP_FILE} && cwebp -jpeg_like -q 75 -o {output_file} ${TEMP_FILE} && rm ${TEMP_FILE}"
},
"png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"cwebp"
],
@ -213,7 +213,7 @@
"command": "cwebp -o {output_file} ${input_file}"
},
"video": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"ffmpeg"
],
@ -225,7 +225,7 @@
"command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -vf scale=-1:720 -c:v libvpx-vp9 -b:v 0 -crf 38 -c:a libopus {output_file}"
},
"audio": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [
"ffmpeg",
"opusenc"

2
pyproject.toml

@ -1,6 +1,6 @@
[tool.poetry]
name = "asset-compression-manager"
version = "1.4.4"
version = "1.5.0"
description = "Helper Utility For Managing Compressed Assets"
authors = ["Drew Short <warrick@sothr.com>"]
license = "Apache2"

2
setup.py

@ -4,7 +4,7 @@ from distutils.core import setup
setup(
name='Asset-Compression-Manager',
version='1.4.0',
version='1.5.0',
description='Helper Utility For Managing Compressed Assets',
author='Drew Short',
author_email='warrick@sothr.com'

11
upload_pipeline.sh

@ -1,11 +0,0 @@
#!/usr/bin/env bash
TEAM=docker
PIPELINE=acm
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd "${DIR}"
fly -t ${TEAM} set-pipeline --pipeline ${PIPELINE} --config pipeline.yml
popd
Loading…
Cancel
Save