diff --git a/Dockerfile b/Dockerfile index e69de29..3c14463 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,46 @@ +FROM ubuntu:18-04-slim + +ARG MOZJPEG_VERSION=3.3.1 + +# Install tooling (ffmpeg, opusenc, optipng, python3) +RUN apt-get update \ + && apt-get install -y \ + ffmpeg \ + python3 \ + python3-pip \ + opus-tools \ + optipng \ + curl + +WORKDIR /tmp + +# Install mozjpeg +RUN curl -LS -o mozjpeg.deb https://mozjpeg.codelove.de/bin/mozjpeg_$MOZJPEG_VERSION_amd64.deb \ + && dpkg -i mozjpeg.deb \ + && rm -f mozjpeg.deb + +# Cleanup image programs and cache +RUN apt-get remove curl \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /acm + +# Copy application +COPY acm.py requirements.txt . + +# Install application requirements +RUN python3 -m pip install -r requirements.txt + +WORKDIR /bin + +# Copy application helper script +COPY docker/acm acm + +# Make script executable +RUN chmod +x acm + +WORKDIR /project + +COPY docker/entrypoint.sh . + +ENTRYPOINT ["entrypoint.sh"] diff --git a/docker/acm b/docker/acm new file mode 100644 index 0000000..e069a2a --- /dev/null +++ b/docker/acm @@ -0,0 +1,5 @@ +#! /bin/sh + +APP_DIRECTORY=/app + +python3 ${APP_DIRECTORY}/acm.py $@ \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..e47b885 --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,3 @@ +#! /bin/sh + +acm $@ \ No newline at end of file