mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
docs: move the reference site to astro starlight (#2527)
This commit is contained in:
+50
-15
@@ -1,28 +1,47 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
ARG BUILD_VERSION
|
||||
|
||||
FROM python:3.13-alpine AS builder
|
||||
FROM node:24-bookworm-slim AS base
|
||||
|
||||
WORKDIR /src/fluxer_docs
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN python -m pip install --no-cache-dir --upgrade pip \
|
||||
&& python -m pip install --no-cache-dir -r requirements.txt
|
||||
RUN corepack enable && corepack prepare [email protected] --activate
|
||||
|
||||
COPY zensical.toml zensical.toml
|
||||
COPY docs docs
|
||||
COPY scripts scripts
|
||||
RUN zensical build --clean \
|
||||
&& python scripts/write_csp_header.py site /tmp/security-headers.conf
|
||||
FROM base AS deploy
|
||||
|
||||
FROM nginxinc/nginx-unprivileged:1.29-alpine AS runtime
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
gcc \
|
||||
libvips-dev \
|
||||
pkg-config \
|
||||
python3 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm --filter @fluxer/config run --if-present generate
|
||||
RUN pnpm --filter fluxer_docs run build
|
||||
RUN pnpm deploy --legacy --filter=fluxer_docs --prod /out
|
||||
|
||||
FROM node:24-bookworm-slim
|
||||
|
||||
ARG BUILD_VERSION=""
|
||||
ARG SOURCE_SHA=""
|
||||
ARG SOURCE_DATE=""
|
||||
|
||||
WORKDIR /usr/src/app/fluxer_docs
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
libvips42 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN corepack enable && corepack prepare [email protected] --activate
|
||||
|
||||
LABEL maintainer="Fluxer"
|
||||
LABEL org.opencontainers.image.title="fluxer-docs"
|
||||
LABEL org.opencontainers.image.description="Fluxer documentation site"
|
||||
LABEL org.opencontainers.image.description="Fluxer API and protocol reference"
|
||||
LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
|
||||
LABEL org.opencontainers.image.vendor="Fluxer"
|
||||
LABEL org.opencontainers.image.url="https://fluxer.app"
|
||||
@@ -33,8 +52,24 @@ LABEL org.opencontainers.image.revision="${SOURCE_SHA}"
|
||||
LABEL org.opencontainers.image.created="${SOURCE_DATE}"
|
||||
LABEL app.fluxer.build-version="${BUILD_VERSION}"
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=builder /tmp/security-headers.conf /etc/nginx/conf.d/security-headers.conf
|
||||
COPY --from=builder /src/fluxer_docs/site /usr/share/nginx/html
|
||||
COPY --from=deploy /out ./
|
||||
COPY --from=deploy /usr/src/app/fluxer_docs/dist ./dist
|
||||
|
||||
RUN mkdir -p /usr/src/app/.cache/corepack && \
|
||||
chown -R 65532:65532 /usr/src/app
|
||||
|
||||
ENV HOME=/usr/src/app
|
||||
ENV COREPACK_HOME=/usr/src/app/.cache/corepack
|
||||
ENV NODE_ENV=production
|
||||
ENV NODE_OPTIONS="--enable-source-maps"
|
||||
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
|
||||
ENV BUILD_VERSION=${BUILD_VERSION}
|
||||
|
||||
USER 65532:65532
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD ["./node_modules/.bin/tsx", "scripts/Healthcheck.ts"]
|
||||
|
||||
CMD ["./node_modules/.bin/tsx", "scripts/StartServer.ts"]
|
||||
|
||||
Reference in New Issue
Block a user