Spaces:
Running
Running
File size: 2,791 Bytes
f67f49a 88209b5 f67f49a 88209b5 da52f70 f67f49a 88209b5 f67f49a da52f70 88209b5 024b43b 88209b5 da52f70 88209b5 17b3872 024b43b 88209b5 17b3872 024b43b 88209b5 024b43b c4fdb31 |
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# ------------------------------------------------------------------------------
# Use the R base image
# ------------------------------------------------------------------------------
FROM rocker/r-base:latest
# ------------------------------------------------------------------------------
# Switch to /code as our working directory
# ------------------------------------------------------------------------------
WORKDIR /code
# ------------------------------------------------------------------------------
# 1) Install system dependencies + Miniconda
# ------------------------------------------------------------------------------
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
wget \
bzip2 \
&& rm -rf /var/lib/apt/lists/*
# Install Miniconda to /opt/conda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh \
&& /bin/bash /tmp/miniconda.sh -b -p /opt/conda \
&& rm /tmp/miniconda.sh \
&& /opt/conda/bin/conda clean -afy
# Make sure conda is on PATH
ENV PATH=/opt/conda/bin:$PATH
# ------------------------------------------------------------------------------
# 2) Install required R packages
# (We add reticulate + a few extras such as DT and shinydashboard
# since your app uses them.)
# ------------------------------------------------------------------------------
RUN install2.r --error \
shiny \
dplyr \
ggplot2 \
readr \
ggExtra \
DT \
parallel \
shinydashboard \
reticulate \
remotes
# ------------------------------------------------------------------------------
# 3) Copy your local code (including app.R and CODEBASE) into the container
# ------------------------------------------------------------------------------
COPY . .
# If your fastrerandomize package is on GitHub and not installed yet,
# uncomment and adjust the GitHub URL as appropriate:
RUN Rscript -e "remotes::install_github('cjerzak/fastrerandomize-software/fastrerandomize')"
# ------------------------------------------------------------------------------
# 4) (Optional) Pre-build the conda environment inside the Docker image
# by calling your 'build_backend()' function.
# This ensures that JAX/numpy are already installed.
# ------------------------------------------------------------------------------
RUN Rscript -e "library(fastrerandomize); fastrerandomize::build_backend(conda='auto')"
# ------------------------------------------------------------------------------
# 5) Expose the Shiny port and set default command to run the Shiny app
# ------------------------------------------------------------------------------
EXPOSE 7860
CMD ["R", "--quiet", "-e", "shiny::runApp('/code', host='0.0.0.0', port=7860)"] |