# 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"]