Skip to content

Commit

Permalink
Build CSS and add to rendered documents
Browse files Browse the repository at this point in the history
  • Loading branch information
bfirsh committed Jul 4, 2018
1 parent 978010b commit 051e0bc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ RUN mkdir -p /app /node_modules
RUN chown engrafo:engrafo /app /node_modules
WORKDIR /app

# Run user as non privileged.
# Install Node packages as non-root so that headless Chrome runs
USER engrafo

# Node
Expand All @@ -72,3 +72,14 @@ ENV PATH /node_modules/.bin:$PATH
ENV PATH="/app/bin:${PATH}"

COPY . /app

# Build production CSS as root because non-root user can't write to /app for
# some reason
USER root

# Build production CSS and JS
RUN yarn run build

# Run everything as normal user so headless Chrome runs. And, you know, for
# security and whatever.
USER engrafo
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"author": "Andreas Jansson & Ben Firshman",
"license": "Apache-2.0",
"scripts": {
"build": "parcel build src/assets/css/index.scss",
"convert": "LATEXML_DOCKER=true bin/engrafo",
"prettier": "prettier --write {src,tests}/**/*.js",
"server": "LATEXML_DOCKER=true bin/engrafo-server",
Expand Down
1 change: 1 addition & 0 deletions script/docker-run
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
ENGRAFO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"

script/run yarn build
exec docker run \
--init \
-v "$ENGRAFO_DIR:/app" \
Expand Down
1 change: 1 addition & 0 deletions src/converter/latexml.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function createChildProcess({ htmlPath, texPath, outputDir }) {
const latexmlArgs = [
"--format", "html5",
"--nodefaultresources",
"--css", "/app/dist/index.css",
"--mathtex",
"--svg",
"--verbose",
Expand Down

0 comments on commit 051e0bc

Please sign in to comment.