Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Docker image #195

Open
juanmc2005 opened this issue Nov 1, 2023 · 4 comments
Open

Create a Docker image #195

juanmc2005 opened this issue Nov 1, 2023 · 4 comments
Labels
ops Improvements to the project that don't impact the code

Comments

@juanmc2005
Copy link
Owner

Problem

Setting up the project is a bit too long with all the dependencies and the use of conda.

Idea

Create and publish docker images with new diart versions, allowing quick setup and deployment

@juanmc2005 juanmc2005 added the ops Improvements to the project that don't impact the code label Nov 1, 2023
@juanmc2005 juanmc2005 modified the milestone: Version 0.9 Nov 1, 2023
@sorgfresser
Copy link
Contributor

I just wrote a really small dockerfile for internal usage but it might be feasible here too

ARG _BASE=debian:bookworm
FROM $_BASE as builder

COPY src /code/src
COPY setup.cfg setup.py requirements.txt pyproject.toml /code/

RUN apt-get update && apt-get install -y --no-install-recommends \
    python3-pip \
    python3-setuptools \
    python3-wheel \
    python3-dev \
    python3-venv \
    build-essential

RUN python3 -m venv /opt/venv
ARG PATH="/opt/venv/bin:$PATH"
ENV PATH="/opt/venv/bin:$PATH"

RUN pip3 install /code

FROM $_BASE

# Runtime deps
RUN apt-get update && apt-get install -y --no-install-recommends \
    python3 \
    python3-venv \
    libportaudio2 \
    ffmpeg \
    && rm -rf /var/lib/apt/lists/*

# Get venv from builder
ARG PATH="/opt/venv/bin:$PATH"
ENV PATH="/opt/venv/bin:$PATH"
COPY --from=builder /opt/venv /opt/venv

@juanmc2005
Copy link
Owner Author

thanks @sorgfresser ! I think you could simplify that by using python:3.10-bookworm. Also, no need to use venv, right?

@v-nhandt21
Copy link

I just wrote a really small dockerfile for internal usage but it might be feasible here too

ARG _BASE=debian:bookworm
FROM $_BASE as builder

COPY src /code/src
COPY setup.cfg setup.py requirements.txt pyproject.toml /code/

RUN apt-get update && apt-get install -y --no-install-recommends \
    python3-pip \
    python3-setuptools \
    python3-wheel \
    python3-dev \
    python3-venv \
    build-essential

RUN python3 -m venv /opt/venv
ARG PATH="/opt/venv/bin:$PATH"
ENV PATH="/opt/venv/bin:$PATH"

RUN pip3 install /code

FROM $_BASE

# Runtime deps
RUN apt-get update && apt-get install -y --no-install-recommends \
    python3 \
    python3-venv \
    libportaudio2 \
    ffmpeg \
    && rm -rf /var/lib/apt/lists/*

# Get venv from builder
ARG PATH="/opt/venv/bin:$PATH"
ENV PATH="/opt/venv/bin:$PATH"
COPY --from=builder /opt/venv /opt/venv

I got some problem with ffmpeg<4.4, how to correctly install it in docker?

@4u9ur
Copy link

4u9ur commented Apr 29, 2024

Would be so great to have a docker image instead of using conda and to avoid having several version bugs between environment & requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ops Improvements to the project that don't impact the code
Projects
None yet
Development

No branches or pull requests

4 participants