kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Remove build dependencies to lighten docker image
rodzic
0ffec0ee34
commit
df62cb8f15
|
@ -1,37 +1,34 @@
|
||||||
FROM alpine:3.10
|
FROM alpine:3.10 as builder
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
echo 'installing dependencies' && \
|
echo 'installing dependencies' && \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
bash \
|
|
||||||
git \
|
git \
|
||||||
gettext \
|
|
||||||
musl-dev \
|
musl-dev \
|
||||||
gcc \
|
gcc \
|
||||||
postgresql-dev \
|
postgresql-dev \
|
||||||
python3-dev \
|
python3-dev \
|
||||||
py3-psycopg2 \
|
py3-psycopg2 \
|
||||||
py3-pillow \
|
|
||||||
libldap \
|
libldap \
|
||||||
ffmpeg \
|
|
||||||
libpq \
|
|
||||||
libmagic \
|
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
make \
|
make \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
|
jpeg-dev \
|
||||||
openldap-dev \
|
openldap-dev \
|
||||||
&& \
|
&& \
|
||||||
\
|
\
|
||||||
ln -s /usr/bin/python3 /usr/bin/python
|
ln -s /usr/bin/python3 /usr/bin/python
|
||||||
|
|
||||||
|
# create virtual env for next stage
|
||||||
|
RUN python -m venv /venv
|
||||||
|
# emulate activation by prefixing PATH
|
||||||
|
ENV PATH="/venv/bin:$PATH" VIRTUAL_ENV=/venv
|
||||||
|
|
||||||
RUN mkdir /requirements
|
RUN mkdir /requirements
|
||||||
COPY ./requirements/base.txt /requirements/base.txt
|
COPY ./requirements/base.txt /requirements/base.txt
|
||||||
# hack around https://github.com/pypa/pip/issues/6158#issuecomment-456619072
|
# hack around https://github.com/pypa/pip/issues/6158#issuecomment-456619072
|
||||||
ENV PIP_DOWNLOAD_CACHE=/noop/
|
ENV PIP_DOWNLOAD_CACHE=/noop/
|
||||||
RUN \
|
RUN \
|
||||||
echo 'fixing requirements file for alpine' && \
|
|
||||||
sed -i '/Pillow/d' /requirements/base.txt && \
|
|
||||||
\
|
|
||||||
echo 'installing pip requirements' && \
|
echo 'installing pip requirements' && \
|
||||||
pip3 install --upgrade pip && \
|
pip3 install --upgrade pip && \
|
||||||
pip3 install setuptools wheel && \
|
pip3 install setuptools wheel && \
|
||||||
|
@ -43,6 +40,26 @@ COPY ./requirements/*.txt /requirements/
|
||||||
RUN \
|
RUN \
|
||||||
if [ "$install_dev_deps" = "1" ] ; then echo "Installing dev dependencies" && pip3 install --no-cache-dir -r /requirements/local.txt -r /requirements/test.txt ; else echo "Skipping dev deps installation" ; fi
|
if [ "$install_dev_deps" = "1" ] ; then echo "Installing dev dependencies" && pip3 install --no-cache-dir -r /requirements/local.txt -r /requirements/test.txt ; else echo "Skipping dev deps installation" ; fi
|
||||||
|
|
||||||
|
|
||||||
|
FROM alpine:3.10 as build-image
|
||||||
|
|
||||||
|
COPY --from=builder /venv /venv
|
||||||
|
# emulate activation by prefixing PATH
|
||||||
|
ENV PATH="/venv/bin:$PATH"
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
libmagic \
|
||||||
|
bash \
|
||||||
|
gettext \
|
||||||
|
python3 \
|
||||||
|
jpeg-dev \
|
||||||
|
ffmpeg \
|
||||||
|
libpq \
|
||||||
|
&& \
|
||||||
|
\
|
||||||
|
ln -s /usr/bin/python3 /usr/bin/python
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["./compose/django/entrypoint.sh"]
|
ENTRYPOINT ["./compose/django/entrypoint.sh"]
|
||||||
CMD ["./compose/django/server.sh"]
|
CMD ["./compose/django/server.sh"]
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Reduced size of funkwhale/funkwhale docker images thanks to multi-stage builds (!1042)
|
Ładowanie…
Reference in New Issue