Files

45 lines
918 B
Docker
Raw Permalink Normal View History

2025-09-01 10:28:41 -07:00
# ---------------------
# Frontend build stage
# ---------------------
2026-04-23 11:06:51 -07:00
# Build on the host arch (BUILDPLATFORM) rather than under QEMU — the output is
# pure JS so it's arch-independent, and this avoids the esbuild host/native
# binary version mismatch under emulation.
FROM --platform=$BUILDPLATFORM node:20-slim AS frontend-build
2025-09-08 06:57:10 -07:00
2025-05-22 09:20:41 -07:00
WORKDIR /app/client
2026-04-23 11:06:51 -07:00
COPY client/package*.json ./
2025-05-22 09:20:41 -07:00
2026-04-23 11:06:51 -07:00
RUN npm ci
2025-05-22 09:20:41 -07:00
2025-09-04 15:15:09 -07:00
COPY client ./
2025-09-01 09:26:51 -07:00
2025-09-01 10:28:41 -07:00
RUN npm run build
# ---------------------
# Backend stage
# ---------------------
2026-01-27 21:26:27 +00:00
FROM node:20-slim AS backend
2025-05-22 09:20:41 -07:00
2025-09-08 20:29:38 -07:00
# Install ping
RUN apt-get update \
&& apt-get install -y iputils-ping \
&& rm -rf /var/lib/apt/lists/*
2025-05-22 09:20:41 -07:00
WORKDIR /app/server
2025-09-04 15:15:09 -07:00
COPY server/package.json ./
2025-09-01 10:32:59 -07:00
2025-09-04 15:15:09 -07:00
RUN npm install
2025-05-22 09:20:41 -07:00
2025-09-01 09:14:35 -07:00
COPY server ./
2025-09-01 10:28:41 -07:00
2025-05-22 09:20:41 -07:00
RUN chmod +x ./scripts/inject-vars.sh
2025-09-22 13:26:45 -07:00
RUN npm run build
COPY --from=frontend-build /app/client/dist ./public
2025-05-22 09:20:41 -07:00
EXPOSE 52345
2025-09-22 13:26:45 -07:00
CMD ["sh", "-c", "./scripts/inject-vars.sh && node ./dist/index.js"]