Skip to content

Commit c830778

Browse files
authored
Merge pull request #107 from pythonhealthdatascience/dev
Dev
2 parents fd7c3d3 + be695f9 commit c830778

File tree

8 files changed

+489
-64
lines changed

8 files changed

+489
-64
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ po/*~
220220
rsconnect/
221221
/.quarto/
222222

223-
# Figure HTML generated by quarto
223+
# Quarto
224224
figure_*.html
225-
226225
_site/
227226
**/*.quarto_ipynb
227+
site_libs/

CONTRIBUTING.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,55 @@ If your name or contributions are missing from the README, or if you contributed
104104
@all-contributors please add @githubuser for ...
105105
```
106106

107-
Then list appropriate contribution types from [allcontributors.org/docs/en/emoji-key](https://allcontributors.org/docs/en/emoji-key) (e.g., code, review, doc, content, bug, ideas, infra).
107+
Then list appropriate contribution types from [allcontributors.org/docs/en/emoji-key](https://allcontributors.org/docs/en/emoji-key) (e.g., code, review, doc, content, bug, ideas, infra).
108+
109+
<br>
110+
111+
## Docker
112+
113+
The GitHub action to build the website uses docker, as this avoids needing to install all the required Python and R packages and system dependencies with every deployment (unless there are environment changes).
114+
115+
If you wish to build the docker image locally to test it out, run this command from the project directory:
116+
117+
```{.bash}
118+
sudo docker build -t desrapbookdocker .
119+
```
120+
121+
To view your available images, run:
122+
123+
```{.bash}
124+
sudo docker images
125+
```
126+
127+
Open the container interactively:
128+
129+
```{.bash}
130+
sudo docker run -it desrapbookdocker /bin/bash
131+
```
132+
133+
Restore R environment:
134+
135+
```{.bash}
136+
Rscript -e "renv::restore()"
137+
```
138+
139+
Edit the conda location in `.Renviron` (if present) to `RETICULATE_CONDA=/opt/conda/bin/conda`:
140+
141+
```{.bash}
142+
apt-get update && apt-get install nano
143+
nano .Renviron
144+
```
145+
146+
Build the website:
147+
148+
```{.bash}
149+
quarto render
150+
```
151+
152+
To close the container: `Ctrl+P` then `Ctrl+Q`.
153+
154+
To delete the image:
155+
156+
```{.bash}
157+
sudo docker image rm -f desrapbookdocker
158+
```

Dockerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,30 @@ RUN apt-get update && \
1818
python3-venv \
1919
build-essential \
2020
pandoc \
21-
chromium-browser \
22-
# Extra browser/system dependencies for Kaleido/Chromium
23-
libnss3 \
21+
# Required for chrome
22+
fonts-liberation \
23+
libasound2 \
2424
libatk-bridge2.0-0 \
25+
libatk1.0-0 \
26+
libatspi2.0-0 \
2527
libcups2 \
28+
libdbus-1-3 \
29+
libgbm1 \
30+
libgtk-3-0 \
31+
libnspr4 \
32+
libnss3 \
33+
libvulkan1 \
2634
libxcomposite1 \
2735
libxdamage1 \
28-
libxfixes3 \
29-
libxrandr2 \
30-
libgbm1 \
3136
libxkbcommon0 \
32-
libpango-1.0-0 \
33-
libcairo2 \
34-
libasound2 \
35-
&& rm -rf /var/lib/apt/lists/*
37+
libxrandr2 \
38+
xdg-utils \
39+
&& rm -rf /var/lib/apt/lists/*
40+
41+
# Install chrome (required by kaleido, which is used for plotly write_image)
42+
RUN wget -O /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
43+
apt-get install -y --no-install-recommends /tmp/chrome.deb && \
44+
rm /tmp/chrome.deb
3645

3746
# Install Quarto CLI
3847
RUN wget -qO- https://quarto.org/download/latest/quarto-linux-amd64.deb > /tmp/quarto.deb && \

environment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dependencies:
66
- flake8=7.3.0
77
- itables=2.5.2
88
- jupyter=1.1.1
9+
- openssl=3.3.0
910
- pandas=2.3.1
1011
- plotly=6.3.0
1112
- pip

0 commit comments

Comments
 (0)