Ark-kun commited on
Commit
6d0c9ea
·
1 Parent(s): e45edcc

feat: Dockerfile - Building UI from GitHub

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -1
Dockerfile CHANGED
@@ -1,3 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
1
  # Use a Python image with uv pre-installed
2
  FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
3
 
@@ -42,7 +53,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \
42
  # Then, add the rest of the project source code and install it
43
  # Installing separately from its dependencies allows optimal layer caching
44
  # COPY backend /app/backend
45
- COPY --chown=user . /app
 
46
  RUN --mount=type=cache,target=/root/.cache/uv \
47
  uv sync --locked --no-dev
48
 
@@ -60,6 +72,8 @@ COPY huggingface_overlay /app/backend
60
  # Copy frontend build
61
  # COPY frontend_build /app/frontend_build
62
 
 
 
63
  # Put Tangle data into persistent storage
64
  RUN mkdir -p /data
65
  RUN ln -s /data/tangle/data /app/backend/data
 
1
+ # Build tangle-ui from GitHub
2
+ FROM node:22 as ui_builder
3
+ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4
+ WORKDIR /app
5
+
6
+ RUN git clone https://github.com/TangleML/tangle-ui.git . && git checkout stable_huggingface
7
+
8
+ RUN npm install
9
+ RUN echo VITE_GIT_COMMIT="$(git rev-parse --short HEAD | tr -d "\n")" >.env
10
+ RUN npm run build:hf
11
+
12
  # Use a Python image with uv pre-installed
13
  FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
14
 
 
53
  # Then, add the rest of the project source code and install it
54
  # Installing separately from its dependencies allows optimal layer caching
55
  # COPY backend /app/backend
56
+ # COPY --chown=user . /app
57
+ COPY --chown=user backend /app/backend
58
  RUN --mount=type=cache,target=/root/.cache/uv \
59
  uv sync --locked --no-dev
60
 
 
72
  # Copy frontend build
73
  # COPY frontend_build /app/frontend_build
74
 
75
+ COPY --from=ui_builder /app/dist /app/frontend_build
76
+
77
  # Put Tangle data into persistent storage
78
  RUN mkdir -p /data
79
  RUN ln -s /data/tangle/data /app/backend/data