-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab.Dockerfile
64 lines (43 loc) · 2.06 KB
/
lab.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM python:3.11-bookworm AS backend-builder
WORKDIR /opt/grapycal
COPY .git .git
COPY .gitmodules .gitmodules
COPY submodules/topicsync submodules/topicsync
COPY submodules/objectsync submodules/objectsync
RUN git submodule update --init --recursive submodules/topicsync
RUN git submodule update --init --recursive submodules/objectsync
# Install Grapycal Lab Communication Core
RUN pip install -e submodules/topicsync
RUN pip install -e submodules/objectsync
# Install Grapycal Lab Core
COPY backend backend
RUN pip install -e backend
# Install Grapycal Lab Extensions
COPY extensions/grapycal_builtin extensions/grapycal_builtin
RUN pip install -e extensions/grapycal_builtin
COPY extensions/grapycal_torch extensions/grapycal_torch
RUN pip install -e extensions/grapycal_torch
FROM node:22.9.0-bookworm as frontend-builder
WORKDIR /opt/grapycal
COPY frontend frontend
RUN cd frontend && npm install
COPY .git .git
COPY .gitmodules .gitmodules
COPY submodules/topicsync-client submodules/topicsync-client
RUN cd submodules/topicsync-client && npm install
COPY submodules/objectsync-client submodules/objectsync-client
RUN cd submodules/objectsync-client && npm install
FROM python:3.11-slim-bookworm
WORKDIR /opt/grapycal
COPY scripts/build_frontend.py scripts/build_frontend.py
COPY --from=backend-builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=backend-builder /opt/grapycal/backend backend
COPY --from=backend-builder /opt/grapycal/submodules/topicsync submodules/topicsync
COPY --from=backend-builder /opt/grapycal/submodules/objectsync submodules/objectsync
COPY --from=backend-builder /opt/grapycal/extensions extensions
COPY --from=backend-builder /usr/local/bin /usr/local/bin
COPY --from=frontend-builder /opt/grapycal/frontend frontend
COPY --from=frontend-builder /opt/grapycal/submodules/topicsync-client submodules/topicsync-client
COPY --from=frontend-builder /opt/grapycal/submodules/objectsync-client submodules/objectsync-client
WORKDIR /usr/local/grapycal/workspace/
CMD ["grapycal", "dev", "--host", "0.0.0.0"]