Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running postcss in docker #12486

Open
kurotych opened this issue May 12, 2024 · 0 comments
Open

Running postcss in docker #12486

kurotych opened this issue May 12, 2024 · 0 comments
Labels
Milestone

Comments

@kurotych
Copy link

kurotych commented May 12, 2024

I want to use a theme (https://github.com/google/docsy) but I don't want to install any NodeJS garbage on my host machine.

As a workaround, I created a Dockerfile, wrapped script and rebuilt hugo

FROM node:20-alpine

WORKDIR /usr/src/app

RUN npm install -g postcss postcss-cli autoprefixer

CMD [""]
docker build -t postcss .

❯ cat postcss

#!/bin/bash
docker run --rm -i postcss postcss "$@"

Rebuild Hugo with a changed next-line because Npx function adding the npx prefix that I don't need.

cmd, err := ex.Npx(binaryName, cmdArgs...)

=>

ex.New(binaryName, cmdArgs...)

It'd be nice to have a configurable binary path to the postcss to make it possible to call without npx prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants