pbnj

Dockerfile-2

# Stage 1 - build
FROM node:20-alpine AS builder

WORKDIR /hexo

RUN apk add --no-cache git
RUN npm install -g hexo-cli

RUN hexo init . && npm install

RUN rm -rf source/* scaffolds themes/landscape

# Clone each build
RUN git clone --depth=1 https://github.com/LTDev-LLC/hexo-theme-flux-palette.git themes/flux-palette && rm -rf themes/flux-palette/.git
# or COPY a local fork/clone
# COPY ../hexo-theme-flux-palette themes/flux-palette

RUN npm install @swc/core

# Copy config and content (source/_posts, source/_projects)
COPY . .
RUN mv theme_config.yml ./themes/flux-palette/_config.yml

# Build the static site
RUN hexo clean && hexo generate || { echo "Hexo generate failed"; exit 1; }

# Stage 2 - run
FROM busybox:latest
COPY --from=builder /hexo/public /www
CMD ["httpd", "-f", "-v", "-p", "8024", "-h", "/www"]