MilkClouds commited on
Commit
35e2bc3
·
verified ·
1 Parent(s): bb4544c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -44
Dockerfile CHANGED
@@ -1,50 +1,20 @@
1
- # This dockerfile is for https://huggingface.co/spaces/open-world-agents/visualize_dataset
 
2
 
3
- # Configure image
4
- ARG PYTHON_VERSION=3.11
5
 
6
- FROM python:${PYTHON_VERSION}-slim
7
- ARG PYTHON_VERSION
8
- ARG DEBIAN_FRONTEND=noninteractive
9
-
10
- # Install apt dependencies
11
- RUN apt-get update && apt-get install -y --no-install-recommends \
12
- build-essential cmake git wget \
13
- libglib2.0-0 libgl1-mesa-glx libegl1-mesa ffmpeg \
14
- && apt-get clean && rm -rf /var/lib/apt/lists/*
15
-
16
- # Setup uv & vuv
17
- COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
18
- RUN --mount=type=cache,target=/root/.cache/uv \
19
- uv pip install virtual-uv --system
20
-
21
- # Create virtual environment
22
- RUN uv venv /opt/venv
23
- ENV VIRTUAL_ENV=/opt/venv
24
- ENV PATH="/opt/venv/bin:$PATH"
25
- RUN echo "source /opt/venv/bin/activate" >> /root/.bashrc
26
-
27
- RUN useradd -m -u 1000 user
28
-
29
- # Install OWA
30
- ARG CACHE_BUST=0
31
  RUN git clone --depth 1 https://github.com/open-world-agents/open-world-agents /owa
32
- WORKDIR /owa
33
- RUN --mount=type=cache,target=/home/user/.cache/uv \
34
- vuv install --frozen
35
 
36
- WORKDIR /owa/projects/owa-mcap-viewer
37
- RUN --mount=type=cache,target=/home/user/.cache/uv \
38
- # --mount=type=bind,source=uv.lock,target=uv.lock \
39
- # --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
40
- vuv install --frozen
41
 
42
- # Prepare example datasets
43
- # RUN --mount=type=cache,target=/home/user/.cache/uv \
44
- # vuv pip install huggingface-hub
45
- # RUN huggingface-cli download open-world-agents/example_dataset --repo-type dataset --local-dir /data
46
- # ENV EXPORT_PATH=/data
47
- # RUN chown -R user:user /data
48
 
49
- RUN chown -R user:user /owa /opt/venv
50
- CMD ["uvicorn", "owa_viewer:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Stage 1: Build
2
+ FROM node:20-alpine AS builder
3
 
4
+ RUN apk add --no-cache git
 
5
 
6
+ ARG CACHE_BUST=1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  RUN git clone --depth 1 https://github.com/open-world-agents/open-world-agents /owa
 
 
 
8
 
9
+ WORKDIR /owa/projects/owa-dataset-visualizer
10
+ RUN npm ci && npm run build
11
+
12
+ # Stage 2: Serve with nginx
13
+ FROM nginx:alpine
14
 
15
+ COPY --from=builder /owa/projects/owa-dataset-visualizer/dist /usr/share/nginx/html
16
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
 
 
 
 
17
 
18
+ # HuggingFace Spaces uses port 7860
19
+ EXPOSE 7860
20
+ CMD ["nginx", "-g", "daemon off;"]