forked from UBCHREST/ablate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerDocsFile
More file actions
36 lines (28 loc) · 1.12 KB
/
DockerDocsFile
File metadata and controls
36 lines (28 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Docker file used to serve the ABLATE docs.
ARG ABLATE_DEPENDENCY_IMAGE=ghcr.io/ubchrest/ablate/ablate-dependencies-gcc:latest
FROM $ABLATE_DEPENDENCY_IMAGE
# Install testing/docs dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y install doxygen python3-inflection ruby-dev ruby-bundler
# Setup the petsc env for tests
ARG PETSC_BUILD_ARCH=arch-ablate-opt
ENV PETSC_ARCH=$PETSC_BUILD_ARCH
ENV PKG_CONFIG_PATH="${PETSC_DIR}/${PETSC_ARCH}/lib/pkgconfig:$PKG_CONFIG_PATH"
ENV PATH="${PETSC_DIR}/${PETSC_ARCH}/bin:$PATH"
# Copy over the source
COPY . /source
WORKDIR /build
# Configure & build
run cmake -DCMAKE_BUILD_TYPE=Release -S /source/ -B .
run make -j $(nproc)
# Build the custom documentation components
run python3 /source/docs/ablateDevGenerator.py --rootDir=/source/ --ablateExe=/build/ablate
# Write the launch script
RUN echo "#!/bin/bash" > /start.sh
RUN echo bundle install >> /start.sh
RUN echo bundle exec jekyll serve --host 0.0.0.0 >> /start.sh
RUN ["chmod", "+x", "/start.sh"]
# Set the working directory to the docs folder
WORKDIR /source/docs
# Set the entry point
ENTRYPOINT ["/start.sh"]