Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM rocker/rstudio:latest

RUN apt-get update \
&& apt-get install -y \
libudunits2-dev \
libgdal-dev

RUN echo "alias l='ls -al'" >> /root/.bashrc

RUN Rscript -e 'install.packages("blogdown")'
RUN Rscript -e 'install.packages("ggplot2")'
RUN Rscript -e 'install.packages("ggthemes")'
RUN Rscript -e 'install.packages("reticulate")'

COPY . /terraref/tutorials

WORKDIR /terraref/tutorials

EXPOSE 3000

CMD Rscript -e 'bookdown::render_book("index.Rmd")' \
&& cd docs \
&& echo 'Starting a web server on http://localhost:3000/ to preview the documentation...' \
&& python -m SimpleHTTPServer 3000
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,38 @@ Although we provide a few pre-configured computing environments, Workbench is de
**To get started**, follow the [Workbench Quick Start](https://htmlpreview.github.io/?https://github.com/terraref/tutorials/blob/master/workbench/ndslabs_workbench_intro.html).

This will walk you through the process of getting started with the first tutorials on how to access data.


## To generate this documentation locally

If you would like to contribute to this documentation you can preview your
changes by running the following command:

```bash
Rscript -e 'bookdown::render_book("index.Rmd")'
```

The output will be in the `docs` folder.

There is also a Dockerfile for convenience. It requires installing Docker on
your computer:

- [Docker for Mac](https://download.docker.com/mac/stable/Docker.dmg)
- [Docker for Windows](https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe)

Build the image:

```bash
docker build -t terraref-tutorials:local .
```

Run the container:

```bash
docker run --rm -p 3000:3000 --name tutorial-preview terraref-tutorials:local
```

This will generate the documentation and start a local web server to preview
your changes. Open the preview URL in your browser: <http://localhost:3000/>

Run `docker kill tutorial-preview` to kill the web server container.
Comment thread
julianpistorius marked this conversation as resolved.