diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ morsel.db morsel.db-wal morsel.db-shm +static/tailwind.css diff --git a/Dockerfile b/Dockerfile --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,10 @@ # Install uv for fast dependency management COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv +# Install Tailwind CSS standalone CLI +ADD https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 /usr/local/bin/tailwindcss +RUN chmod +x /usr/local/bin/tailwindcss + # Copy dependency files first (layer caching) COPY pyproject.toml uv.lock ./ @@ -14,6 +18,10 @@ # Copy application code COPY main.py config.py identity.py atproto_oauth.py schema.sql ./ COPY templates/ templates/ +COPY static/input.css static/ + +# Build Tailwind CSS +RUN tailwindcss -i static/input.css -o static/tailwind.css --minify # Create data directory for secrets and database RUN mkdir -p /data diff --git a/justfile b/justfile new file mode 100644 --- /dev/null +++ b/justfile @@ -0,0 +1,22 @@ +default: dev + +# Run dev server with CSS watching +dev: + tailwindcss -i static/input.css -o static/tailwind.css --watch & + uv run flask --app main run --debug + +# Build CSS for production +build-css: + tailwindcss -i static/input.css -o static/tailwind.css --minify + +# Build Docker image +build: + docker build -t morsels . + +# Run with Docker Compose +up: + docker compose up -d + +# View logs +logs: + docker compose logs -f diff --git a/static/input.css b/static/input.css new file mode 100644 --- /dev/null +++ b/static/input.css @@ -0,0 +1,1 @@ +@import "tailwindcss" source("../templates"); diff --git a/templates/base.html b/templates/base.html --- a/templates/base.html +++ b/templates/base.html @@ -3,7 +3,11 @@ - + {% block title %}morsels{% endblock %}