Skip to content

Commit 4193901

Browse files
committed
[Docker] Add npm build
Signed-off-by: Herklos <herklos@drakkar.software>
1 parent c6f8e66 commit 4193901

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,6 @@ ENV/
103103

104104
# documentation
105105
docs
106+
107+
# Node
108+
node_modules

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
FROM node:22-slim AS frontend
2+
3+
WORKDIR /app
4+
COPY package.json package-lock.json ./
5+
RUN npm ci
6+
COPY octobot_script/resources/report/ octobot_script/resources/report/
7+
COPY vite.config.ts tsconfig*.json ./
8+
RUN npm run build
9+
110
FROM python:3.13-slim-bullseye AS base
211

312
WORKDIR /app
@@ -7,6 +16,7 @@ RUN apt-get update \
716
&& apt-get install -y --no-install-recommends build-essential git gcc binutils
817

918
COPY . .
19+
COPY --from=frontend /app/octobot_script/resources/report/dist/ octobot_script/resources/report/dist/
1020

1121
RUN pip3 install --no-cache-dir -U setuptools wheel pip \
1222
&& pip3 install --no-cache-dir -r requirements.txt \

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222

2323
def _build_report():
24+
if os.path.isfile(REPORT_DIST):
25+
print(f"[report] Pre-built bundle found → {REPORT_DIST}, skipping JS build.")
26+
return
27+
2428
npm = "npm"
2529

2630
print("[report] Installing JS dependencies…")

0 commit comments

Comments
 (0)