From f762f6eec570be6c973b63bce54775630b25342e Mon Sep 17 00:00:00 2001 From: skytomo Date: Sun, 6 Jul 2025 19:50:11 +0900 Subject: [PATCH] build: add Dockerfile for local build environment - Added a Dockerfile to simplify the setup process for building the reference manual locally. - Updated the README with instructions for building and running the manual using Docker. --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ README.md | 18 ++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..9da8f65ce --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + git \ + python3 \ + poppler-utils \ + texlive-luatex \ + texlive-latex-extra \ + texlive-pictures \ + texlive-fonts-extra \ + texlive-fonts-recommended \ + fonts-inter \ + fonts-texgyre \ + fonts-font-awesome \ + gcc \ + build-essential \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +RUN curl https://elan.lean-lang.org/elan-init.sh -sSf | sh -s -- -y + +ENV PATH="/root/.elan/bin:${PATH}" + +WORKDIR /app +COPY . . + +RUN lake exe generate-manual --depth 2 + +EXPOSE 8880 + +CMD ["python3", "server.py", "8880"] diff --git a/README.md b/README.md index c5b24f652..a916d5ef8 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,24 @@ python3 ./server.py 8880 & Then open in your browser. +## Building the Reference Manual Using Docker + +If you prefer to use Docker, you can build and run the reference manual without installing dependencies manually. Follow these steps: + +1. Build the Docker image: + + ```bash + docker build -t reference-manual . + ``` + +2. Run the Docker container: + + ```bash + docker run -p 8880:8880 reference-manual + ``` + +3. Open in your browser to view the reference manual. + ## Contributing Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.