-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile.spa
More file actions
51 lines (35 loc) · 1.67 KB
/
Dockerfile.spa
File metadata and controls
51 lines (35 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Compile NTIA ITM to WASM. Pinned to same emsdk as frontend/wasm/itm/Dockerfile.
# --platform=linux/amd64: emsdk only publishes amd64; WASM output is arch-neutral
# so QEMU-emulating this stage on arm64 runners is fine.
FROM --platform=linux/amd64 emscripten/emsdk:3.1.74 AS wasm-build
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /itm
COPY frontend/wasm/itm/fetch-vendor.sh frontend/wasm/itm/build.sh frontend/wasm/itm/shim.h ./
RUN chmod +x fetch-vendor.sh build.sh && ./fetch-vendor.sh && ./build.sh
FROM node:25.9.0-alpine AS build
LABEL org.opencontainers.image.source="https://github.com/MeshAddicts/meshinfo"
LABEL org.opencontainers.image.description="Realtime web UI to run against a Meshtastic regional or private mesh network."
WORKDIR /frontend
ARG env=production
ENV NODE_ENV=$env
RUN rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg \
&& npm install -g corepack \
&& corepack enable
COPY frontend/package.json frontend/yarn.lock frontend/.yarnrc.yml ./
COPY frontend/.yarn ./.yarn
RUN yarn install --immutable
COPY frontend/ ./
# .d.ts for tsc; .js goes to public/ because the worker's @vite-ignore'd
# import expects /generated/itm/itm.js at a fixed URL.
COPY --from=wasm-build /itm/dist/itm.d.ts ./src/generated/itm/itm.d.ts
RUN mkdir -p ./public/generated/itm
COPY --from=wasm-build /itm/dist/itm.js ./public/generated/itm/itm.js
RUN yarn build --base=/
FROM caddy:2-alpine
COPY --from=build /frontend/dist /srv
COPY Caddyfile.frontend /etc/caddy/Caddyfile
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
EXPOSE 80
ENTRYPOINT ["/docker-entrypoint.sh"]