From 575b4b70aa26d8d4393e19d58b33cc3bbd1f45c4 Mon Sep 17 00:00:00 2001 From: Francesco Capuano Date: Thu, 10 Jul 2025 18:47:28 +0200 Subject: [PATCH] wip(docker) --- Dockerfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..1d7a56797 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +# Configure image +ARG PYTHON_VERSION=3.10 +FROM python:${PYTHON_VERSION}-slim + +# Configure environment variables +ARG PYTHON_VERSION +ENV DEBIAN_FRONTEND=noninteractive +ENV MUJOCO_GL="egl" +ENV PATH="/opt/venv/bin:$PATH" + +# Install dependencies and set up Python in a single layer +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential cmake git \ + libglib2.0-0 libgl1-mesa-glx libegl1-mesa ffmpeg \ + speech-dispatcher libgeos-dev \ + && ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python \ + && python -m venv /opt/venv \ + && apt-get clean && rm -rf /var/lib/apt/lists/* \ + && echo "source /opt/venv/bin/activate" >> /root/.bashrc + +# Clone repository and install LeRobot in a single layer +COPY . /lerobot +WORKDIR /lerobot +RUN /opt/venv/bin/pip install --upgrade --no-cache-dir pip \ + && /opt/venv/bin/pip install --no-cache-dir ".[async, smolvla]" \ + --extra-index-url https://download.pytorch.org/whl/cpu + +# Execute in bash shell rather than python +CMD ["/bin/bash"] + +EXPOSE 8080 8081 +CMD ["python", "-m", "lerobot.scripts.server.policy_server", "--host=0.0.0.0", "--port=8080"]