Some checks are pending
Build Ghidra Plugin / build (push) Waiting to run
Starlight/Astro docs site following the warehack.ing cookie-cutter pattern. Landing page with architecture overview, getting-started guide with install and firmware import examples, Docker reference with env vars and port pool docs, and MCP tools reference. Warm amber/rust color scheme. Caddy prod + Node dev Docker stages.
62 lines
1.2 KiB
Docker
62 lines
1.2 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# -- Build stage --
|
|
FROM node:22-alpine AS builder
|
|
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json pnpm-lock.yaml ./
|
|
|
|
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
|
|
pnpm install --frozen-lockfile
|
|
|
|
COPY . .
|
|
|
|
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
RUN pnpm build
|
|
|
|
# -- Production stage --
|
|
FROM caddy:2-alpine AS production
|
|
|
|
COPY --from=builder /app/dist /srv
|
|
|
|
COPY <<EOF /etc/caddy/Caddyfile
|
|
:80 {
|
|
root * /srv
|
|
encode gzip
|
|
try_files {path} {path}/
|
|
file_server
|
|
header Cache-Control "public, max-age=3600"
|
|
@immutable path /_astro/*
|
|
header @immutable Cache-Control "public, max-age=31536000, immutable"
|
|
handle_errors {
|
|
rewrite * /404.html
|
|
file_server
|
|
}
|
|
}
|
|
EOF
|
|
|
|
EXPOSE 80
|
|
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]
|
|
|
|
# -- Dev stage --
|
|
FROM node:22-alpine AS dev
|
|
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json pnpm-lock.yaml ./
|
|
|
|
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
|
|
pnpm install --frozen-lockfile
|
|
|
|
COPY . .
|
|
|
|
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
EXPOSE 4321
|
|
|
|
CMD ["pnpm", "dev"]
|