funkwhale/api/Dockerfile

74 wiersze
1.8 KiB
Docker
Czysty Zwykły widok Historia

FROM alpine:3.13 as builder
RUN \
echo 'installing dependencies' && \
apk add --no-cache \
git \
musl-dev \
gcc \
postgresql-dev \
python3-dev \
py3-psycopg2 \
libldap \
libffi-dev \
2019-06-19 08:54:45 +00:00
make \
zlib-dev \
jpeg-dev \
2020-02-04 10:43:08 +00:00
openldap-dev \
openssl-dev \
cargo \
2021-06-30 15:41:12 +00:00
libxml2-dev \
libxslt-dev \
2020-02-02 08:43:54 +00:00
&& \
\
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
2017-12-16 15:22:46 +00:00
COPY ./requirements/base.txt /requirements/base.txt
2019-01-24 10:04:29 +00:00
# hack around https://github.com/pypa/pip/issues/6158#issuecomment-456619072
ENV PIP_DOWNLOAD_CACHE=/noop/
RUN \
echo 'installing pip requirements' && \
2019-01-24 10:04:29 +00:00
pip3 install --upgrade pip && \
pip3 install setuptools wheel && \
pip3 install -r /requirements/base.txt && \
rm -rf $PIP_DOWNLOAD_CACHE
ARG install_dev_deps=0
COPY ./requirements/*.txt /requirements/
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
FROM alpine:3.13 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 \
2021-06-30 15:41:12 +00:00
libxml2 \
libxslt \
&& \
\
ln -s /usr/bin/python3 /usr/bin/python
ENTRYPOINT ["./compose/django/entrypoint.sh"]
CMD ["./compose/django/server.sh"]
COPY . /app
WORKDIR /app