-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·59 lines (47 loc) · 1.74 KB
/
Dockerfile
File metadata and controls
executable file
·59 lines (47 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# syntax=docker/dockerfile:1
# Create pipenv image to convert Pipfile to requirements.txt
FROM python:3.11-slim AS pipenv
# 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.11-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.11-slim
LABEL maintainer="CollinHeist" \
description="Automated Title card maker for Emby, Jellyfin, and Plex" \
version="v1.16.0"
# 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.11/site-packages /usr/local/lib/python3.11/site-packages
# Script environment variables
ENV TCM_PREFERENCES=/config/preferences.yml \
TCM_IS_DOCKER=TRUE
# Delete setup files
# Create user and group to run the container
# Install imagemagick
# Clean up apt cache
# Override default ImageMagick policy XML file
RUN \
set -eux && \
rm -f Pipfile Pipfile.lock && \
groupadd -g 99 titlecardmaker && \
useradd -u 100 -g 99 titlecardmaker && \
apt-get update && \
apt-get install -y --no-install-recommends \
imagemagick && \
rm -rf /var/lib/apt/lists/* && \
cp modules/ref/policy.xml /etc/ImageMagick-7/policy.xml
VOLUME [ "/config" ]
# Entrypoint
CMD ["python3", "main.py", "--run", "--no-color"]
ENTRYPOINT ["bash", "./start.sh"]