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

@ -0,0 +1,20 @@
name: Nightly Docker Build
on:
push:
schedule:
- cron: '0 0 * * *' # Midnight
workflow_dispatch: # Allow manual runs
jobs:
build-and-push:
runs-on: alpine:latest
steps:
- name: Install dependencies
run: apk add docker nodejs
- name: Login to Docker registry
run: docker login git.arinity.org -u matt -p "${{ secrets.DOCKER_PUSH_TOKEN }}"
- name: Checkout repository
uses: actions/checkout@v4
- name: Build & Push Docker image
run: docker build --push --no-cache -t git.arinity.org/meshsense-tools/meshsense:nightly .

View File

@ -1,20 +1,46 @@
FROM alpine:latest AS build FROM node:20-alpine 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
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 FROM alpine:latest
WORKDIR /app 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 COPY --from=build /src/api/dist /app
CMD ["node", "index.cjs"] CMD ["node", "index.cjs"]