From 096251f8cec331f0910bfc4c6abe8e0f4f3756d8 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sun, 10 Mar 2024 13:37:54 +1100 Subject: [PATCH] move to using base image of python, not ubuntu, update requirements to use pip for as much as we can and not mix and match some apt get and pip3 for python dependencies --- Dockerfile | 22 ++++------------------ requirements.txt | 4 +++- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index ab037f6..e9ce761 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,13 @@ -FROM ubuntu:22.04 +FROM python:latest WORKDIR /code -USER root ENV PJM_UID=500 ENV PJM_GID=500 RUN groupadd -g ${PJM_GID} mythtv && useradd -r -u ${PJM_UID} -g ${PJM_GID} mythtv -ENV TZ=Australia/Melbourne -RUN truncate -s0 /tmp/preseed.cfg && \ - (echo "tzdata tzdata/Areas select Australia" >> /tmp/preseed.cfg) && \ - (echo "tzdata tzdata/Zones/Australia select Melbourne" >> /tmp/preseed.cfg) && \ - debconf-set-selections /tmp/preseed.cfg && \ - rm -f /etc/timezone /etc/localtime && \ - apt-get update && \ - DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \ - apt-get install -y tzdata -RUN apt-get update && apt-get -y dist-upgrade && apt-get -y install python3-pip libpq-dev gunicorn mediainfo cmake libgl1-mesa-glx libglib2.0-0 python3-ldap libjpeg-turbo-progs ffmpeg git -COPY requirements.txt requirements.txt +RUN apt-get update && apt-get -y install libpq-dev mediainfo cmake libgl1-mesa-glx libglib2.0-0 libjpeg-turbo-progs ffmpeg git +COPY . . RUN pip3 install -r requirements.txt RUN pip3 install --upgrade pillow --user -EXPOSE 443 -EXPOSE 55432 -COPY . . +EXPOSE 80 RUN echo $RANDOM | md5sum | head -c 30 > /code/.sk RUN chmod 600 .sk RUN date > internal/build-date.txt @@ -30,6 +18,4 @@ RUN rm -rf .git RUN chown mythtv:mythtv /code RUN chown mythtv:mythtv ./static RUN chown mythtv:mythtv ./static/* -## cleanup of files from setup -RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* CMD ["./wrapper.sh"] diff --git a/requirements.txt b/requirements.txt index 607fcb4..a615e3f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -flask +flask==2.3.3 flask_login flask-ldap3-login sqlalchemy @@ -19,3 +19,5 @@ Werkzeug flask-compress ffmpeg-python psycopg2 +python3-ldap +gunicorn