Skip to content

Commit

Permalink
[#15] Run python:3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
xserrat committed Nov 27, 2022
1 parent 4537f88 commit f246cdc
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM python:3.8-alpine3.16 as lameenc-build

RUN apt install -y python-setuptools pip build-essential cmake

ENV PATH="/opt/venv/bin:$PATH"

RUN python3 -m venv /opt/venv
RUN apk update && apk add git cmake build-base gcc py3-setuptools

RUN python3 -m pip install --user wheel

# Install lameenc
RUN mkdir -p /lib/lameenc
WORKDIR /lib/lameenc

Expand All @@ -16,15 +15,18 @@ RUN mkdir -p /lib/lameenc/build
WORKDIR /lib/lameenc/build
RUN cmake ..
RUN make
RUN pip install "lameenc-1.3.1-cp38-cp38-linux_aarch64.whl"

FROM python:3.8-alpine3.16
RUN python3 -m venv /opt/venv
RUN python3 -m pip install /lib/lameenc/build/lameenc-1.3.1-cp38-cp38-linux_x86_64.whl

# syntax=docker/dockerfile:1
FROM python:3.11-alpine3.16
USER root
ENV PATH="/opt/venv/bin:$PATH"
ENV TORCH_HOME=/data/models
ENV REQUIREMENTS_FILE=requirements_minimal.txt

COPY --from=lameenc-build /opt/venv /opt/venv
#COPY --from=lameenc-build /opt/venv /opt/venv

# Install needed packages
RUN apk update && apk add \
Expand All @@ -39,9 +41,11 @@ WORKDIR /lib/demucs

RUN git clone --depth 1 --branch main https://github.com/facebookresearch/demucs .

#RUN REQUIREMENTS_FILE=$([[ "${DEMUCS_VERSION}" == "minimal" ]] && echo "requirements_minimal.txt" || echo "requirements.txt")
RUN python3 -m venv /opt/venv

RUN sed '/lameenc>=1.2/d' ${REQUIREMENTS_FILE}
#RUN sed -i '/lameenc>=1.2/d' ${REQUIREMENTS_FILE}
RUN sed -i 's/lameenc>=1.2/lameenc==1.4.2/g' ${REQUIREMENTS_FILE}
RUN cat ${REQUIREMENTS_FILE}
RUN python3 -m pip install -r ${REQUIREMENTS_FILE}
RUN python3 -m demucs.separate -d cpu --mp3 test.mp3 # Trigger model download \
&& rm -r separated # cleanup
Expand Down

0 comments on commit f246cdc

Please sign in to comment.