-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
31 lines (22 loc) · 935 Bytes
/
Dockerfile
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
FROM rocker/r-bspm:22.04
# install nginx
RUN apt-get update && apt-get install -y nginx
# install R dependencies
RUN apt-get update && apt-get install -y r-cran-rmarkdown r-cran-blogdown
# install Hugo
RUN echo "options(blogdown.hugo.version = '0.78.2')" >> /etc/R/Rprofile.site
RUN Rscript -e "blogdown::install_hugo('0.78.2')"
# update xfun
RUN Rscript -e "bspm::disable(); install.packages('xfun', repos = 'https://cloud.r-project.org/', type = 'source'); bspm::enable()"
# copy site
COPY . /site
# build site
RUN cd /site && Rscript -e "blogdown::build_site(build_rmd = TRUE)"
EXPOSE 80
# configure site
RUN rm -rf /var/www/html && \
rm -rf /etc/nginx/sites-enabled/default && \
rm -rf /etc/nginx/sites-available/default && \
cp /site/.config/nginx.conf /etc/nginx/sites-available/terourou && \
ln -s /etc/nginx/sites-available/terourou /etc/nginx/sites-enabled/terourou
CMD ["nginx", "-g", "daemon off;"]