feat: add blog system with static site generator
- Add blog posts in Markdown (_posts/) - Build script converts MD to HTML at container build time - First posts: building with AI lessons, quick start guide - AGENTS.md documents blog writing style (unixsheikh-inspired)
This commit is contained in:
@@ -1,11 +1,26 @@
|
||||
FROM nginx:alpine
|
||||
FROM node:20-alpine
|
||||
|
||||
COPY www/ /usr/share/nginx/html/
|
||||
COPY docker-entrypoint.d/ /docker-entrypoint.d/
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies for blog build
|
||||
COPY www/package.json ./www/package.json
|
||||
RUN cd www && npm install --silent 2>/dev/null || true
|
||||
|
||||
# Copy www source files
|
||||
COPY www/ /app/www/
|
||||
|
||||
# Build blog (processes _posts/*.md to blog/*.html)
|
||||
RUN node www/build-blog.js
|
||||
|
||||
# Run envsubst on HTML files
|
||||
RUN apk add --no-cache gettext && \
|
||||
chmod +x /docker-entrypoint.d/*.sh
|
||||
chmod +x /docker-entrypoint.d/*.sh 2>/dev/null || true
|
||||
|
||||
# Copy entrypoint
|
||||
COPY docker-entrypoint.d/ /docker-entrypoint.d/
|
||||
RUN chmod +x /docker-entrypoint.d/*.sh
|
||||
|
||||
# Copy to nginx document root
|
||||
COPY --from=0 /app/www/ /usr/share/nginx/html/
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.d/30-envsubst.sh", "--", "nginx", "-g", "daemon off;"]
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
Reference in New Issue
Block a user