- Add multi-stage CSS build that compiles Tailwind into app/static/tw.css
- Add Tailwind config with dark tokens (bg/nav/card) and purge globs
- Add assets/input.css (@tailwind base/components/utilities + small utilities)
- Replace Tailwind CDN + REMOVE Flowbite CSS (keep Flowbite JS only)
- New base_tailwind.html (top navbar, responsive container, {%- block scripts -%})
- Port pages to Tailwind look/feel with wider content column:
- index: single-column form + recent results, fullscreen spinner overlay, copy-UUID
- result: sticky jump list, Tailwind tables/badges, Suspicious Scripts/Forms sections
- viewer: Monaco-based code viewer in Tailwind card, actions (copy/wrap/raw)
- ssl_tls macro: rewritten with Tailwind (details/summary for raw JSON)
- Dockerfile: add css-builder stage and copy built tw.css into /app/app/static
- Remove Flowbite stylesheet to avoid overrides; Flowbite JS loaded with defer
BREAKING CHANGE:
Legacy CSS classes/components (.card, .badge, etc.) are replaced by Tailwind utilities.
All templates now expect tw.css to be served from /static.
58 lines
1.7 KiB
Docker
58 lines
1.7 KiB
Docker
# --- Stage 1: CSS builder (no npm) ---
|
|
FROM alpine:3.20 AS css-builder
|
|
WORKDIR /css
|
|
RUN apk add --no-cache curl
|
|
|
|
# Download Tailwind standalone CLI
|
|
# (Update version if desired; linux-x64 works on Alpine)
|
|
RUN curl -sL https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.10/tailwindcss-linux-x64 \
|
|
-o /usr/local/bin/tailwindcss && chmod +x /usr/local/bin/tailwindcss
|
|
|
|
# Config + sources
|
|
COPY tailwind/tailwind.config.js ./
|
|
COPY assets ./assets
|
|
COPY app/templates ./app/templates
|
|
COPY app/static ./app/static
|
|
|
|
# Build Tailwind CSS
|
|
RUN tailwindcss -i ./assets/input.css -o ./tw.css --minify
|
|
|
|
# --- Stage 2: Playwright python image with requirements.
|
|
|
|
# Use the official Playwright image with browsers preinstalled
|
|
FROM mcr.microsoft.com/playwright/python:v1.45.0-jammy
|
|
|
|
# Create a non-root user (the base image already has pwuser, we'll keep it)
|
|
USER root
|
|
|
|
# System deps (whois, dig, etc. — handy for later stages)
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
whois dnsutils iputils-ping ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy requirements first to leverage Docker layer caching
|
|
COPY requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code (the double app is needed because the app folder needs to be inside the app folder)
|
|
COPY app/ /app/app/
|
|
|
|
# Bring in the compiled CSS from Stage 1
|
|
COPY --from=css-builder /css/tw.css /app/app/static/tw.css
|
|
|
|
COPY entrypoint.sh ./entrypoint.sh
|
|
RUN chmod +x /app/entrypoint.sh
|
|
|
|
# Create data dir for screenshots/artifacts
|
|
RUN mkdir -p /data && chown -R pwuser:pwuser /data /app
|
|
|
|
USER pwuser
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Start server
|
|
ENTRYPOINT ["/app/entrypoint.sh"] |