update Dockerfile, build nightly
Some checks failed
Nightly Docker Build / build-and-push (push) Has been cancelled
Some checks failed
Nightly Docker Build / build-and-push (push) Has been cancelled
This commit is contained in:
56
Dockerfile
56
Dockerfile
@ -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"]
|
||||
|
Reference in New Issue
Block a user