-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Jellyfin, reduce Docker image size, other minor changes and fixes
- Loading branch information
Showing
56 changed files
with
3,567 additions
and
1,234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: multi-build-docker | ||
on: | ||
workflow_call: | ||
inputs: | ||
tag: | ||
required: true | ||
type: string | ||
secrets: | ||
DOCKER_HUB_USERNAME: | ||
required: true | ||
DOCKER_HUB_ACCESS_TOKEN: | ||
required: true | ||
GH_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Out Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
- name: Login to GHCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Set up QEMU for ARM emulation | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and Push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
platforms: linux/amd64,linux/arm64 # edit this if you want to build more architectures | ||
push: true | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/titlecardmaker:${{ inputs.tag }},ghcr.io/collinheist/titlecardmaker:${{ inputs.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,53 @@ | ||
# syntax=docker/dockerfile:1 | ||
# Create pipenv image to convert Pipfile to requirements.txt | ||
FROM python:3.9-slim as pipenv | ||
|
||
# Set base image | ||
# Copy Pipfile and Pipfile.lock | ||
COPY Pipfile Pipfile.lock ./ | ||
|
||
# Install pipenv and convert to requirements.txt | ||
RUN pip3 install --no-cache-dir --upgrade pipenv; \ | ||
pipenv requirements > requirements.txt | ||
|
||
FROM python:3.9-slim as python-reqs | ||
|
||
# Copy requirements.txt from pipenv stage | ||
COPY --from=pipenv /requirements.txt requirements.txt | ||
|
||
# Install gcc for building python dependencies; install TCM dependencies | ||
RUN apt-get update; \ | ||
apt-get install -y gcc; \ | ||
pip3 install --no-cache-dir -r requirements.txt | ||
|
||
# Set base image for running TCM | ||
FROM python:3.9-slim | ||
LABEL maintainer="CollinHeist" | ||
LABEL description="Automated title card maker for Plex" | ||
LABEL maintainer="CollinHeist" \ | ||
description="Automated title card maker for Plex" | ||
|
||
# Set working directory, copy source into container | ||
WORKDIR /maker | ||
COPY . /maker | ||
|
||
# Copy python packages from python-reqs | ||
COPY --from=python-reqs /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages | ||
|
||
# Script environment variables | ||
ENV TCM_PREFERENCES=/config/preferences.yml | ||
ENV TCM_IS_DOCKER=TRUE | ||
ENV TCM_PREFERENCES=/config/preferences.yml \ | ||
TCM_IS_DOCKER=TRUE | ||
|
||
# Delete setup files | ||
# Create user and group to run the container | ||
RUN groupadd -g 314 titlecardmaker; \ | ||
useradd -u 314 -g 314 titlecardmaker | ||
|
||
# Install gosu | ||
# Install gosu, imagemagick | ||
# Clean up apt cache | ||
# Override default ImageMagick policy XML file | ||
RUN set -eux; \ | ||
rm -f Pipfile Pipfile.lock; \ | ||
groupadd -g 314 titlecardmaker; \ | ||
useradd -u 314 -g 314 titlecardmaker; \ | ||
apt-get update; \ | ||
apt-get install -y gosu; \ | ||
apt-get install -y --no-install-recommends gosu imagemagick; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
gosu nobody true | ||
|
||
# Intall OS dependencies | ||
RUN apt-get update; \ | ||
apt-get upgrade -y --no-install-recommends; \ | ||
apt-get install -y gcc; \ | ||
apt update | ||
|
||
# Install ImageMagick | ||
RUN apt install -y imagemagick | ||
RUN export MAGICK_HOME="$HOME/ImageMagick-7.1.0"; \ | ||
export PATH="$MAGICK_HOME/bin:$PATH"; \ | ||
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/" | ||
|
||
# Override default ImageMagick policy XML file | ||
RUN cp /maker/modules/ref/policy.xml /etc/ImageMagick-6/policy.xml | ||
|
||
# Install TCM package dependencies | ||
RUN pip3 install --no-cache-dir --upgrade pipenv; \ | ||
pipenv requirements > requirements.txt; \ | ||
pip3 install -r requirements.txt | ||
|
||
# Delete setup files | ||
RUN rm -f Pipfile Pipfile.lock requirements.txt | ||
|
||
# Uninstall OS dependencies | ||
RUN apt-get autoremove --purge -y gcc; \ | ||
apt-get clean; \ | ||
apt-get autoclean | ||
cp modules/ref/policy.xml /etc/ImageMagick-6/policy.xml | ||
|
||
# Entrypoint | ||
CMD ["python3", "main.py", "--run", "--no-color"] | ||
ENTRYPOINT ["bash", "./start.sh"] | ||
ENTRYPOINT ["bash", "./start.sh"] |
Oops, something went wrong.