new Dockerfiles for musician and orchestra
orchestra: 1.28GB -> 848MB musician: 497MB -> 169MB
This commit is contained in:
parent
45eef003a7
commit
9a67710ec3
|
@ -1,16 +1,19 @@
|
|||
# right now this is this is heavily inspired to git repo django-musician/Dockerfile
|
||||
#FROM python
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
RUN apt update && apt-get install -y \
|
||||
python3-minimal \
|
||||
python3-pip \
|
||||
python3-dev \
|
||||
python-is-python3
|
||||
FROM python:3.11.7-slim-bookworm
|
||||
|
||||
WORKDIR /opt/musician
|
||||
|
||||
RUN python3 -m pip install --upgrade pip
|
||||
# reduce size (python specifics) -> src https://stackoverflow.com/questions/74616667/removing-pip-cache-after-installing-dependencies-in-docker-image
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
# here document in dockerfile src https://stackoverflow.com/questions/40359282/launch-a-cat-command-unix-into-dockerfile
|
||||
RUN cat > /etc/pip.conf <<END
|
||||
[install]
|
||||
compile = no
|
||||
|
||||
[global]
|
||||
no-cache-dir = True
|
||||
END
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install wheel
|
||||
|
||||
COPY django-musician/requirements.txt .
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM debian:bullseye-slim
|
||||
FROM python:3.9.18-slim-bullseye
|
||||
|
||||
# based on https://github.com/glic3rinu/django-orchestra/blob/master/INSTALL.md
|
||||
# HOW TO RUN THIS
|
||||
|
@ -15,15 +15,10 @@ FROM debian:bullseye-slim
|
|||
|
||||
#RUN apt-get update -y && apt-get upgrade -y
|
||||
|
||||
RUN apt update && apt-get install -y \
|
||||
python3-minimal \
|
||||
python3-pip \
|
||||
RUN apt update && apt-get install --no-install-recommends -y \
|
||||
postgresql \
|
||||
python3-psycopg2 \
|
||||
cron \
|
||||
nginx-full \
|
||||
uwsgi \
|
||||
uwsgi-plugin-python3 \
|
||||
sudo \
|
||||
ca-certificates \
|
||||
gettext \
|
||||
|
@ -36,13 +31,32 @@ RUN apt update && apt-get install -y \
|
|||
ssh \
|
||||
wkhtmltopdf \
|
||||
xvfb \
|
||||
python3-minimal \
|
||||
python3-dev \
|
||||
zlib1g-dev \
|
||||
libcrack2-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
python-is-python3
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# reduce size (python specifics) -> src https://stackoverflow.com/questions/74616667/removing-pip-cache-after-installing-dependencies-in-docker-image
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
# here document in dockerfile src https://stackoverflow.com/questions/40359282/launch-a-cat-command-unix-into-dockerfile
|
||||
RUN cat > /etc/pip.conf <<END
|
||||
[install]
|
||||
compile = no
|
||||
|
||||
[global]
|
||||
no-cache-dir = True
|
||||
END
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
|
||||
# using binaries I avoid installing c compiler
|
||||
# pyuwsgi -> src https://discuss.python.org/t/how-to-install-uwsgi-package-from-pypi/25082/5
|
||||
# setuptools before installing requirements and the anyjson python package -> src https://stackoverflow.com/questions/72414481/error-in-anyjson-setup-command-use-2to3-is-invalid/74272722#74272722
|
||||
RUN pip install \
|
||||
"setuptools<58.0.0" \
|
||||
psycopg2-binary \
|
||||
pyuwsgi
|
||||
|
||||
# Clean up to reduce image size
|
||||
RUN apt clean && rm -rf /var/lib/apt/lists/*
|
||||
|
@ -86,8 +100,8 @@ WORKDIR /opt/orchestra/
|
|||
COPY django-orchestra/requirements.txt .
|
||||
|
||||
# TODO fix this better in the repo itself
|
||||
RUN pip3 install -r requirements.txt
|
||||
RUN pip3 install lxml==4.9.3
|
||||
RUN pip install -r requirements.txt
|
||||
RUN pip install lxml==4.9.3
|
||||
|
||||
COPY django-orchestra .
|
||||
#RUN sed -i 's/lxml==3.3.5/lxml==4.9.3/' requirements.txt
|
||||
|
|
Reference in New Issue