mishig HF Staff commited on
Commit
f5898c7
·
verified ·
1 Parent(s): ba89d21

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -29
Dockerfile CHANGED
@@ -1,31 +1,27 @@
1
- # Configure image
2
- ARG PYTHON_VERSION=3.10
3
 
4
- FROM python:${PYTHON_VERSION}-slim
5
- ARG PYTHON_VERSION
6
- ARG DEBIAN_FRONTEND=noninteractive
7
-
8
- # Install apt dependencies
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
- build-essential cmake git wget \
11
- libglib2.0-0 libgl1-mesa-glx libegl1-mesa ffmpeg \
12
- && apt-get clean && rm -rf /var/lib/apt/lists/*
13
-
14
- # Create virtual environment
15
- RUN ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python
16
- RUN python -m venv /opt/venv
17
- ENV PATH="/opt/venv/bin:$PATH"
18
- RUN echo "source /opt/venv/bin/activate" >> /root/.bashrc
19
-
20
- RUN useradd -m -u 1000 user
21
-
22
- # Install LeRobot
23
- RUN git clone https://github.com/huggingface/lerobot.git /lerobot
24
- WORKDIR /lerobot
25
- RUN pip install --upgrade --no-cache-dir pip
26
- RUN pip install --no-cache-dir "." \
27
- --extra-index-url https://download.pytorch.org/whl/cpu
28
- RUN pip install --no-cache-dir flask
29
-
30
- COPY --chown=user . /lerobot
31
- CMD ["python", "lerobot/scripts/visualize_dataset_html.py", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ FROM node:18-slim
 
2
 
3
+ # Install git and clean up in one step to keep the image size down
 
 
 
 
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ git \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ # Set working directory
9
+ WORKDIR /app
10
+
11
+ # Clone the repository with depth 1 (shallow clone)
12
+ RUN git clone --depth 1 -b update_html_visualizer https://github.com/mishig25/lerobot.git .
13
+
14
+ # Change to the HTML visualizer directory
15
+ WORKDIR /app/lerobot/html_dataset_visualizer
16
+
17
+ # Install production dependencies only
18
+ RUN npm ci --production
19
+
20
+ # Expose port 7860
21
+ EXPOSE 7860
22
+
23
+ # Set environment variable for port
24
+ ENV PORT=7860
25
+
26
+ # Start the application
27
+ CMD ["npm", "start"]