Added Sass to container

This commit is contained in:
2026-09-10 08:40:18 -07:00
parent 1d378f5ea4
commit 551efc0c36
2 changed files with 27 additions and 5 deletions
+6 -2
View File
@@ -194,5 +194,9 @@ except `public/cache/*` and `novaconium/contact-log.txt`.
`App/css/main.css` (project-owned; docker-compose mounts `App/css` to `App/css/main.css` (project-owned; docker-compose mounts `App/css` to
the container's `public/css`, and it's served at `/css/main.css`): the container's `public/css`, and it's served at `/css/main.css`):
`sass --load-path=App/sass --load-path=novaconium/sass/defaults --no-source-map novaconium/sass/main.sass App/css/main.css` `sass --load-path=App/sass --load-path=novaconium/sass/defaults --no-source-map novaconium/sass/main.sass App/css/main.css`
— commit the regenerated CSS. See `/admin/docs/styling` for a Docker — commit the regenerated CSS. The Docker image ships Dart Sass standalone
fallback if `sass` isn't installed locally. (pinned `DART_SASS_VERSION` in the `Dockerfile`, symlinked to
`/usr/local/bin/sass`), so the same command runs inside the container;
bump that version deliberately, like the PHP base tag. See
`/admin/docs/styling` for the Docker fallback if `sass` isn't installed
locally.
+21 -3
View File
@@ -1,6 +1,4 @@
# Official PHP + Apache image for running novaconium in production. # Official PHP + Apache image for running novaconium in production.
# See /admin/docs/docker for the bind-mounted paths, docker-entrypoint.sh's
# seeding/permissions behavior, and optional MySQL wiring.
# Build: docker build --no-cache -t novaconium:latest . # Build: docker build --no-cache -t novaconium:latest .
@@ -14,11 +12,31 @@ FROM php:8.5.8-apache-trixie
# rebuild. # rebuild.
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends libsqlite3-dev \ && apt-get install -y --no-install-recommends libsqlite3-dev curl ca-certificates \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install pdo_sqlite pdo_mysql \ && docker-php-ext-install pdo_sqlite pdo_mysql \
&& a2enmod rewrite && a2enmod rewrite
# Dart Sass standalone, so the container can compile
# novaconium/sass/main.sass -> App/css/main.css itself (see AGENTS.md
# "Conventions worth knowing" and /admin/docs/styling). Debian trixie has
# no usable dart-sass package, so pull the pinned upstream release tarball.
# Bump DART_SASS_VERSION deliberately, like the PHP base tag above.
ENV DART_SASS_VERSION=1.83.4
RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
amd64) sass_arch='x64' ;; \
arm64) sass_arch='arm64' ;; \
*) echo "unsupported arch: $arch" >&2; exit 1 ;; \
esac; \
curl -fsSL -o /tmp/dart-sass.tar.gz \
"https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-${sass_arch}.tar.gz"; \
tar -xzf /tmp/dart-sass.tar.gz -C /opt; \
rm /tmp/dart-sass.tar.gz; \
ln -s /opt/dart-sass/sass /usr/local/bin/sass; \
sass --version
# Point DocumentRoot at public/ and allow .htaccess overrides there. # Point DocumentRoot at public/ and allow .htaccess overrides there.
RUN sed -ri -e 's#/var/www/html#/var/www/html/public#g' \ RUN sed -ri -e 's#/var/www/html#/var/www/html/public#g' \
/etc/apache2/sites-available/*.conf \ /etc/apache2/sites-available/*.conf \