From b3bffd8ba841e389b9eac55c6a462c015ecbcdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 9 Nov 2025 09:55:58 +0100 Subject: [PATCH] fix: mount custom.css to assets directory, not css MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit static_paths only includes: assets, fonts, images, js The css directory is NOT served by Phoenix. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- asciinema/Dockerfile | 26 ++++++++++++++++++++++++++ asciinema/compose.yaml | 2 +- asciinema/theme/custom.js | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 asciinema/Dockerfile diff --git a/asciinema/Dockerfile b/asciinema/Dockerfile new file mode 100644 index 0000000..6b5822e --- /dev/null +++ b/asciinema/Dockerfile @@ -0,0 +1,26 @@ +FROM ghcr.io/asciinema/asciinema-server:latest AS base + +# Download the source to find and patch the template +FROM elixir:1.18-alpine AS builder + +# Install git and build dependencies +RUN apk add --no-cache git build-base nodejs npm + +# Clone the asciinema-server repository +WORKDIR /app +RUN git clone https://github.com/asciinema/asciinema-server.git . +RUN git checkout v1.0.0 + +# Patch the layout template to inject custom theme +RUN sed -i '/<\/head>/i\ \n \n ' \ + lib/asciinema_web/templates/layout/app.html.heex + +# Build the release +RUN mix local.hex --force && \ + mix local.rebar --force && \ + mix deps.get --only prod && \ + MIX_ENV=prod mix do compile, assets.deploy, release + +# Final image: copy the patched release over the base image +FROM base +COPY --from=builder /app/_build/prod/rel/asciinema /opt/app/ diff --git a/asciinema/compose.yaml b/asciinema/compose.yaml index fef5cab..46ed47c 100644 --- a/asciinema/compose.yaml +++ b/asciinema/compose.yaml @@ -8,7 +8,7 @@ services: volumes: - asciinema_data:/var/opt/asciinema - ./custom.exs:/opt/app/etc/custom.exs:ro - - ./theme/custom.css:/opt/app/lib/asciinema-1.0.0/priv/static/css/custom.css:ro + - ./theme/custom.css:/opt/app/lib/asciinema-1.0.0/priv/static/assets/custom.css:ro - ./theme/favicon.svg:/opt/app/lib/asciinema-1.0.0/priv/static/images/favicon-custom.svg:ro - ./theme/custom.js:/opt/app/lib/asciinema-1.0.0/priv/static/js/custom.js:ro environment: diff --git a/asciinema/theme/custom.js b/asciinema/theme/custom.js index 9a6a4b6..3ea1542 100644 --- a/asciinema/theme/custom.js +++ b/asciinema/theme/custom.js @@ -3,7 +3,7 @@ // Inject custom CSS var customCSS = document.createElement('link'); customCSS.rel = 'stylesheet'; - customCSS.href = '/css/custom.css'; + customCSS.href = '/assets/custom.css'; document.head.appendChild(customCSS); // Inject custom favicon