Add Docker deployment infrastructure for docs-site

This commit is contained in:
Ryan Malloy 2026-02-23 15:51:06 -07:00
parent c06de02236
commit 3d8bc3b090
6 changed files with 54 additions and 0 deletions

3
docs-site/.dockerignore Normal file
View File

@ -0,0 +1,3 @@
node_modules
dist
.env

2
docs-site/.env.example Normal file
View File

@ -0,0 +1,2 @@
COMPOSE_PROJECT_NAME=mcmqtt-docs
DOMAIN=mcmqtt.warehack.ing

9
docs-site/Caddyfile.prod Normal file
View File

@ -0,0 +1,9 @@
:80 {
encode gzip
handle {
root * /srv
try_files {path} {path}/ /index.html
file_server
}
}

13
docs-site/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
# Build stage
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
ENV ASTRO_TELEMETRY_DISABLED=1
RUN npm run build
# Serve stage
FROM caddy:2-alpine
COPY --from=builder /app/dist /srv
COPY Caddyfile.prod /etc/caddy/Caddyfile

14
docs-site/Makefile Normal file
View File

@ -0,0 +1,14 @@
.PHONY: up down logs restart
up:
docker compose up -d --build
@sleep 3
docker compose logs --tail=20
down:
docker compose down
logs:
docker compose logs -f
restart: down up

View File

@ -0,0 +1,13 @@
services:
docs:
build: .
restart: unless-stopped
networks:
- caddy
labels:
caddy: ${DOMAIN:-mcmqtt.warehack.ing}
caddy.reverse_proxy: "{{upstreams 80}}"
networks:
caddy:
external: true