Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_site/
_docs/
_docs/*
assets/external-docs/
.external-docs/
.sass-cache/
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ WORKDIR /srv/content
USER root
ENV BUNDLE_PATH=/srv/bundle

RUN apk add --no-cache python3 bash \
&& mkdir -p /srv/bundle && \
chmod -R 777 /srv/bundle
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 bash \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /srv/bundle \
&& chmod -R 777 /srv/bundle

# Keep container running root for gem installation and avoid permission issues
# Scripts will handle gem install automatically
# Scripts will handle gem install automatically
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
COMPOSE_FILE := ./docker-compose.yaml
CONTAINER := anylog-docs

# Directory to mount as the documentation source.
# Override on the command line, e.g.:
# make up LOCAL_DOCS=/path/to/docs
LOCAL_DOCS ?= .

.PHONY: up logs down clean check-dir help

.DEFAULT_GOAL := help

help:
@echo "Usage: make [target] [LOCAL_DOCS=/path/to/docs]"
@echo ""
@echo "Targets:"
@echo " up Start the docs container (docker compose up -d)"
@echo " logs Follow logs for the $(CONTAINER) container"
@echo " down Stop the docs container (docker compose down)"
@echo " clean Stop and remove containers, volumes, and images"
@echo " help Show this message"
@echo ""
@echo "LOCAL_DOCS defaults to '.' and sets the mounted documentation directory."

# Validate LOCAL_DOCS exists before doing anything, unless it's "."
check-dir:
@if [ "$(LOCAL_DOCS)" != "." ] && [ ! -d "$(LOCAL_DOCS)" ]; then \
echo "Failed to locate Docker directory: $(LOCAL_DOCS)"; \
exit 1; \
fi

up: check-dir
LOCAL_DOCS=$(LOCAL_DOCS) docker compose -f $(COMPOSE_FILE) up --build -d

logs:
docker logs -f $(CONTAINER)

down: check-dir
LOCAL_DOCS=$(LOCAL_DOCS) docker compose -f $(COMPOSE_FILE) down

clean: check-dir
LOCAL_DOCS=$(LOCAL_DOCS) docker compose -f $(COMPOSE_FILE) down -v --rmi all

# Catch-all: anything that isn't a defined target is an invalid option
%:
@echo "Invalid option: $@"
@$(MAKE) --no-print-directory help
@exit 1
Loading