update Dockerfile, build nightly
Some checks failed
Nightly Docker Build / build-and-push (push) Has been cancelled

This commit is contained in:
2025-07-03 19:52:59 -04:00
parent ee5e85f2b2
commit 9c0f8c470b
2 changed files with 61 additions and 15 deletions

View File

@ -1,20 +1,46 @@
FROM alpine:latest AS build
ARG GIT_REF="main"
WORKDIR /src
RUN apk add git cmake nodejs npm alpine-sdk dbus-dev
COPY . .
#RUN git clone --recurse-submodules --branch ${GIT_REF} https://github.com/Affirmatech/MeshSense.git .
# Web Bluetooth
RUN cd api/webbluetooth && npm i && npm run build:all
# Meshtastic JS
RUN cd api/meshtastic-js && npm i && npm run build
# Install dependencies
RUN cd ui && npm i && cd ../api && npm i
# Build
RUN cd ui && npm run build && cd ../api && npm run build
FROM node:20-alpine AS build
ARG GIT_REF=master
# Install build dependencies
RUN apk add --no-cache git cmake alpine-sdk dbus-dev && npm install -g typescript
# Clone the repository using GIT_REF (tag or branch)
WORKDIR /src
RUN git clone --recurse-submodules https://github.com/Affirmatech/MeshSense.git . && \
git checkout "${GIT_REF}"
# Web Bluetooth build
WORKDIR /src/api/webbluetooth
RUN npm install \
&& npm run build:all
# Meshtastic JS build
WORKDIR /src/api/meshtastic-js
RUN npm install \
&& npm run build
# Install main API and UI dependencies
WORKDIR /src/ui
RUN npm install
WORKDIR /src/api
RUN npm install
# Build UI and API
WORKDIR /src/ui
RUN npm run build
WORKDIR /src/api
RUN npm run build
# Final image
FROM alpine:latest
WORKDIR /app
RUN apk add nodejs dbus-dev
RUN apk add --no-cache nodejs dbus-dev
# Copy built output
COPY --from=build /src/api/dist /app
CMD ["node", "index.cjs"]