Skip to content

Commit

Permalink
[#15] Upgrade python to 3.11 and build lameenc manually
Browse files Browse the repository at this point in the history
  • Loading branch information
xserrat committed Dec 28, 2022
1 parent f246cdc commit 697ddbc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-alpine3.16 as lameenc-build
FROM python:3.11-alpine3.15 as lameenc-build

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

Expand All @@ -20,13 +20,13 @@ 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
FROM python:3.11-alpine3.15
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 @@ -43,9 +43,7 @@ RUN git clone --depth 1 --branch main https://github.com/facebookresearch/demucs

RUN python3 -m venv /opt/venv

#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 sed -i '/lameenc>=1.2/d' ${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 697ddbc

Please sign in to comment.