-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
43 lines (29 loc) · 1.5 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
FROM rocker/tidyverse:3.6.1
WORKDIR /app
## Adiciona client do postgres para atualização do banco de dados remoto
RUN apt-get update && apt-get install -y gnupg2
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update
RUN yes Y | apt-get install postgresql-client-10
RUN apt-get install -y libpoppler-cpp-dev
## Cria arquivo para indicar raiz do repositório (Usado pelo pacote here)
RUN touch .here
## Instala dependências
RUN R -e "install.packages(c('here', 'optparse', 'RCurl', 'xml2', 'ellipsis', 'digest'), repos='http://cran.rstudio.com/')"
RUN Rscript -e 'devtools::install_version("dplyr", version = "0.8.5", repos = "http://cran.us.r-project.org")'
RUN R -e "devtools::install_github('analytics-ufcg/rcongresso', force = T)"
RUN R -e "devtools::install_github('analytics-ufcg/leggoR', force = T)"
RUN R -e "devtools::install_github('Cepesp-Fgv/cepesp-r')"
RUN apt-get install -y libjpeg-dev
RUN R -e "install.packages('pdftools')"
RUN R -e "install.packages('eeptools')"
## Configura cron para execução automática da atualização
ENV TZ=America/Recife
RUN apt-get update && apt-get -y install cron
RUN echo "0 7 * * 2 /bin/sh /app/bd/update.sh >> /app/bd/cron-job.log 2>&1" > /etc/cron.d/cron-job
RUN chmod 0644 /etc/cron.d/cron-job
RUN crontab /etc/cron.d/cron-job
COPY .env .env
RUN cp .env /etc/environment
ENTRYPOINT ["cron", "-f"]