File size: 850 Bytes
e77f270
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use the official R image as the base image
FROM rocker/r-base:4.3.0

# Install system dependencies including libsodium
RUN apt-get update && apt-get install -y \

    libcurl4-openssl-dev \
    libssl-dev \
    libxml2-dev \
    libgit2-dev \
    libsodium-dev \  
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
	
# Install plumber dependencies manually
RUN R -e "install.packages(c('stringi', 'jsonlite', 'webutils', 'httpuv', 'promises'), repos='https://cloud.r-project.org/')"

# Install plumber package
RUN R -e "install.packages('plumber', repos='https://cloud.r-project.org/')"

# Set the working directory
WORKDIR /app

# Copy the API and Server scripts into the container
COPY . /app

# Expose the port that the API will run on
EXPOSE 8080

# CMD to run the Server script
CMD ["Rscript", "Server.R"]