From fab41ce9fdba520a8ec103c412a0610f6a4e7370 Mon Sep 17 00:00:00 2001 From: andreacfromtheapp <3269984+andreacfromtheapp@users.noreply.github.com> Date: Thu, 25 Sep 2025 13:37:02 +0200 Subject: [PATCH 1/4] fix: issue 4865 Docker build failed Signed-off-by: andreacfromtheapp <3269984+andreacfromtheapp@users.noreply.github.com> --- README.md | 73 +++++++++++++++++++++++++--------------- publishing/Dockerfile | 31 +++++++++++------ publishing/run_server.sh | 0 3 files changed, 67 insertions(+), 37 deletions(-) mode change 100644 => 100755 publishing/run_server.sh diff --git a/README.md b/README.md index 48831e793..913519ba1 100644 --- a/README.md +++ b/README.md @@ -181,33 +181,52 @@ you intend to build the website or email newsletter. ### Building the website -*Before attempting to build the website, ensure Docker is in a running state on your system.* - -* Enter the `publishing/` directory: - ```sh - cd publishing - ``` -* Run the Docker build and website local-host command: - ```sh - make build && make generate-website && make host-content - ``` -* View the website locally at default http://localhost:8000, or specific posts - at http://localhost:8000/blog/{YEAR}/{MONTH}/{DAY}/{ISSUE}/ - -Note: If looking to test the website's search functionality locally, you will need to adjust the [`TESTING_LOCALLY`](https://github.com/rust-lang/this-week-in-rust/blob/dc127f17fcabbf0f058eb3d5a3febba434ddca83/pelicanconf.py#L7) -variable to `True`. +> [!IMPORTANT] +> +> Before attempting to build the website, ensure Docker is in a running state on +> your system. + +- Enter the `publishing/` directory: + +```sh +cd publishing +``` + +- Run the Docker build and website local-host command: + +```sh +make build && make generate-website && make host-website +``` + +- View the website locally at default + [http://localhost:8000](http://localhost:8000), or specific posts at + `http://localhost:8000/blog/{YEAR}/{MONTH}/{DAY}/{ISSUE}/` + +> [!NOTE] +> +> If looking to test the website's search functionality locally, you will need +> to adjust the +> [`TESTING_LOCALLY`](https://github.com/rust-lang/this-week-in-rust/blob/dc127f17fcabbf0f058eb3d5a3febba434ddca83/pelicanconf.py#L7) +> variable to `True`. ### Building the newsletter -*Before attempting to build the email newsletter, ensure Docker is in a running state on your system.* - -* Enter the `publishing/` directory: - ```sh - cd publishing - ``` -* Run the Docker build and website local-host command: - ```sh - make build && make generate-email && make host-content - ``` -* View the email newsletter formatting of specific posts at - http://localhost:8000/blog/{YEAR}/{MONTH}/{DAY}/{ISSUE}/ +> [!IMPORTANT] +> +> Before attempting to build the website, ensure Docker is in a running state on +> your system. + +- Enter the `publishing/` directory: + +```sh +cd publishing +``` + +- Run the Docker build and website local-host command: + +```sh +make build && make generate-email && make host-website +``` + +- View the email newsletter formatting of specific posts at + `http://localhost:8000/blog/{YEAR}/{MONTH}/{DAY}/{ISSUE}/` diff --git a/publishing/Dockerfile b/publishing/Dockerfile index b2216b23c..44894fdf9 100644 --- a/publishing/Dockerfile +++ b/publishing/Dockerfile @@ -1,21 +1,31 @@ -FROM --platform=linux/amd64 python:3.8.16-slim +FROM python:3.8.16-slim -# Must run from base TWIR directory... makefile takes care of this. +# Must run from base `twir` directory... Makefile takes care of this. WORKDIR /usr/twir -RUN apt-get update && apt-get install -y curl build-essential +# Install deps and set locales +RUN apt-get update && apt-get install -y curl build-essential locales \ + && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ + && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 -# pelican+friends -ENV LANG='en_US.UTF-8' -ENV LC_ALL='en_US.UTF-8' +# Set explicit locale environment variables +ENV LC_ALL=en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US.UTF-8 + +# PELICAN+FRIENDS +# install python reqs COPY requirements.txt . RUN pip3 install -r requirements.txt + +# install Stork RUN curl https://files.stork-search.net/releases/v1.5.0/stork-ubuntu-20-04 -o stork \ && chmod +x stork \ && mv ./stork /usr/bin/stork -# sass/juice -RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - +# install sass/juice +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - RUN apt-get install -y nodejs RUN npm install -g sass juice @@ -25,7 +35,8 @@ COPY plugins plugins COPY themes themes COPY pelicanconf.py pelicanconf.py -COPY publishing/*.sh ./ -RUN chmod 777 *.sh +# make build && make generate-website && make host-website needs these scripts +COPY publishing/*.sh . +RUN chmod +x *.sh CMD ["pelican", "--delete-output-directory", "content"] diff --git a/publishing/run_server.sh b/publishing/run_server.sh old mode 100644 new mode 100755 From f3ba603f9e5f8c25d2eb8492170fedc03650479a Mon Sep 17 00:00:00 2001 From: Andrea C <3269984+andreacfromtheapp@users.noreply.github.com> Date: Wed, 1 Oct 2025 08:36:20 +0200 Subject: [PATCH 2/4] Update README.md Co-authored-by: Nell Shamrell-Harrington --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 913519ba1..2c9b84ffb 100644 --- a/README.md +++ b/README.md @@ -225,7 +225,7 @@ cd publishing - Run the Docker build and website local-host command: ```sh -make build && make generate-email && make host-website +make email ``` - View the email newsletter formatting of specific posts at From e865918bbdfb0fb1d0bbfcab1420f241c7cc2d02 Mon Sep 17 00:00:00 2001 From: Andrea C <3269984+andreacfromtheapp@users.noreply.github.com> Date: Wed, 1 Oct 2025 08:36:29 +0200 Subject: [PATCH 3/4] Update README.md Co-authored-by: Nell Shamrell-Harrington --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c9b84ffb..994f8a981 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ cd publishing - Run the Docker build and website local-host command: ```sh -make build && make generate-website && make host-website +make copy-website-contents ``` - View the website locally at default From 62a2119f0eadcaa318b75885ffab33ed58af45e8 Mon Sep 17 00:00:00 2001 From: Nell Shamrell-Harrington Date: Wed, 1 Oct 2025 17:15:18 -0700 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 994f8a981..e7e88cf13 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ cd publishing - Run the Docker build and website local-host command: ```sh -make copy-website-contents +make website ``` - View the website locally at default