Skip to content

Commit

Permalink
Move from jinjanator to minijinja-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcooper committed Sep 20, 2024
1 parent 29cb79e commit 886c6b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
16 changes: 12 additions & 4 deletions server/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
FROM jonasal/nginx-certbot:5.4-alpine
FROM rust:alpine AS minijina-builder

ARG PIP_BREAK_SYSTEM_PACKAGES=1
ARG JINJANATOR_VERSION=24.3.0
ARG MINIJINJA_VERSION=2.3.1
RUN cargo install \
--root /build \
--version "${MINIJINJA_VERSION}" \
--no-default-features \
minijinja-cli \
&& strip /build/bin/minijinja-cli

RUN pip install --no-cache-dir "jinjanator==${JINJANATOR_VERSION}"

FROM jonasal/nginx-certbot:5.4-alpine AS final

COPY --from=minijina-builder /build/bin/minijinja-cli /usr/local/bin/

ADD image/ /
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ auto_j2() {
output_path="$output_dir/${relative_path%$suffix}"
subdir=$(dirname "$relative_path")
mkdir -p "$output_dir/$subdir"
entrypoint_log "$ME: Running jinjanate on $template to $output_path"
jinjanate --quiet "$template" > "$output_path"
entrypoint_log "$ME: Running minijinja-cli on $template to $output_path"
minijinja-cli --env --strict --output "$output_path" "$template"
done
}

Expand Down
4 changes: 2 additions & 2 deletions server/nginx/image/etc/nginx/templates/app.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ server {
listen 443 ssl default_server reuseport;
http2 on;

server_name {{ DOMAIN_NAME }};
server_name {{ ENV.DOMAIN_NAME }};

ssl_certificate /etc/letsencrypt/live/tomato/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/tomato/privkey.pem;
Expand All @@ -24,7 +24,7 @@ server {
client_max_body_size 25M;
client_body_buffer_size 1M;

{% if DEBUG|int %}
{% if ENV.DEBUG|int %}
# Static files disabled by when DEBUG is true
{% else %}
# Static files enabled when DEBUG is false
Expand Down

0 comments on commit 886c6b6

Please sign in to comment.