mcserial/docs/Dockerfile
Ryan Malloy dc8caddb8f Add Starlight documentation site with full content
Astro 5 + Starlight docs site with 17 pages covering all 30 mcserial
tools. Structured using Diataxis framework: tutorials, guides, reference,
and concepts. Includes Docker + caddy-docker-proxy deployment for
mcserial.l.zmesh.systems with HMR support behind reverse proxy.

Content pages:
- Landing page with feature overview and quick start
- Tutorials: getting started, loopback testing (loop://)
- Guides: RS-232 basics, RS-485/Modbus, file transfers, network ports
- Reference: common tools, RS-232 tools, RS-485 tools, file transfer
  tools, URL schemes, MCP resources, environment variables
- Concepts: RS-232 vs RS-485, flow control
2026-02-02 22:01:48 -07:00

49 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1
# ============================================
# Base stage — Node 22 slim
# ============================================
FROM node:22-slim AS base
WORKDIR /app
COPY package.json package-lock.json ./
# ============================================
# Development — hot reload
# ============================================
FROM base AS dev
RUN npm ci
COPY . .
EXPOSE 4321
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
# ============================================
# Build — static site generation
# ============================================
FROM base AS build
RUN npm ci
COPY . .
ENV ASTRO_TELEMETRY_DISABLED=1
RUN npm run build
# ============================================
# Production — Caddy serves static files
# ============================================
FROM caddy:2-alpine AS prod
COPY --from=build /app/dist /usr/share/caddy
RUN echo ':80 { \
root * /usr/share/caddy \
encode gzip \
try_files {path} {path}/ /index.html \
file_server \
}' > /etc/caddy/Caddyfile
EXPOSE 80
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]