Skip to content

Commit

Permalink
Merge pull request #2184 from laws-africa/bootstrap
Browse files Browse the repository at this point in the history
bootstrap must be available when compiling assets during deployment
  • Loading branch information
longhotsummer authored Aug 14, 2024
2 parents ba3d4ed + f4de083 commit 00938e0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ RUN wget -q -O fop.tgz 'http://www.apache.org/dyn/closer.cgi?filename=/xmlgraphi

ENV PATH=/usr/local/share/fop-2.4/fop:$PATH

# dart sass
RUN wget -q -O dart-sass.tgz 'https://github.com/sass/dart-sass/releases/download/1.53.0/dart-sass-1.53.0-linux-x64.tar.gz' && \
tar xzf dart-sass.tgz && \
mv dart-sass/sass /usr/local/bin && \
rm -rf dart-sass*
# node
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs
# install sass for compiling assets before deploying
RUN npm i -g sass

WORKDIR /app

# install runtime node dependencies
# copying this in first means Docker can cache this operation
COPY package*.json /app/
RUN npm ci --no-audit --ignore-scripts --omit=dev

# Bring pip up to date; pip <= 22 (the default on ubuntu 22.04) is not supported
RUN pip install --upgrade pip

Expand Down
11 changes: 8 additions & 3 deletions indigo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,14 @@
"pipeline.finders.PipelineFinder",
)

SASS_PROCESSOR_INCLUDE_DIRS = [
os.environ.get("NODE_PATH") or os.path.join(BASE_DIR, "node_modules"),
]
if os.environ.get("NODE_PATH"):
SASS_PROCESSOR_INCLUDE_DIRS = [os.environ.get("NODE_PATH")]
else:
# look for node modules in the current dir, and in the project root
SASS_PROCESSOR_INCLUDE_DIRS = [
os.path.join(".", "node_modules"),
os.path.join(BASE_DIR, "node_modules"),
]

# supplement whitenoise's mimetypes
WHITENOISE_MIMETYPES = {
Expand Down
10 changes: 4 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
"directories": {
"doc": "docs"
},
"dependencies": {
"bootstrap": "^5.3.2"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.2.0",
"@lawsafrica/bluebell-monaco": "^4.7.3",
"@lawsafrica/indigo-akn": "^5.4.0",
"@lawsafrica/law-widgets": "^2.0.1",
"bootstrap": "^5.3.2",
"bootstrap-select": "^1.13.18",
"bower": "^1.8.8",
"canopy": "^0.4.1",
Expand Down

0 comments on commit 00938e0

Please sign in to comment.