File size: 1,416 Bytes
e8fee27
6c8b83d
 
e8fee27
 
 
 
 
6c8b83d
1ded7ce
 
6681bc3
e8fee27
 
 
 
 
 
 
 
 
 
 
68a7502
6681bc3
 
 
68a7502
 
6681bc3
 
68a7502
42e2f33
68a7502
a6b8fb2
 
 
eb18aca
e8fee27
6c8b83d
 
 
384525a
728b206
6349f19
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
44
45
# Rôle du fichier : Dockerfile porte une partie du pipeline d'analyse IRaMuTeQ-like.
FROM rocker/r2u:22.04

ENV LANG=C.UTF-8 \
    LC_ALL=C.UTF-8 \
    DEBIAN_FRONTEND=noninteractive \
    HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

ENV CHD_STATS_CORES=2

# Création de l'utilisateur non-root compatible Hugging Face
RUN set -eux; \
    if ! id -u user >/dev/null 2>&1; then \
      if getent passwd 1000 >/dev/null 2>&1; then \
        useradd -m -u 1001 user; \
      else \
        useradd -m -u 1000 user; \
      fi; \
    fi

WORKDIR /home/user/app

# Python pour spaCy
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
      ca-certificates \
      python3 \
      python3-pip \
    && rm -rf /var/lib/apt/lists/*

# Paquets R (r2u installe en binaires via apt/bspm, donc très rapide)
RUN install.r shiny quanteda wordcloud RColorBrewer igraph dplyr htmltools remotes irlba markdown factoextra

# FactoMineR depuis GitHub (sans tirer les Suggests)
RUN R -q -e "options(repos=c(CRAN='https://cloud.r-project.org')); remotes::install_github('husson/FactoMineR', dependencies=NA, upgrade='never')"

# Copie de l'application
COPY --chown=user:user . /home/user/app

USER user
EXPOSE 7860

# Lancement direct de l'application Shiny
CMD ["R", "--vanilla", "-q", "-e", "port <- as.integer(Sys.getenv('PORT', '7860')); shiny::runApp('/home/user/app', host='0.0.0.0', port=port)"]