onconpc/onconpc-visualization
2
1# Start from a base image with Python 3.82FROM python:3.93 4# Install R base5RUN apt-get update && apt-get install -y r-base && rm -rf /var/lib/apt/lists/*6 7# # Set environment variables to make sure R and Python play nicely together8# ENV R_HOME=/usr/lib/R9# ENV RPY2_CFFI_MODE=ABI10 11# Copy your requirements.txt file into the container12COPY requirements.txt /tmp/13 14# Install Python dependencies from requirements.txt15# Note: Remove rpy2 from requirements.txt and install it here if necessary16RUN pip install -r /tmp/requirements.txt17RUN pip install rpy2==3.5.1118ENV MPLCONFIGDIR /tmp/matplotlib_cache19ENV FONTCONFIGDIR /tmp/20ENV HOME=/homep21 22RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser23 24# Set permissions for fontconfig cache directory25RUN mkdir -p /opt/X11/var/cache/fontconfig && \26 chmod -R 755 /opt/X11/var/cache/fontconfig && \27 chown -R appuser:appgroup /opt/X11/var/cache/fontconfig28 29 30# Install R packages from CRAN and Bioconductor31RUN R -e "install.packages(c('reshape2', 'remotes'), repos='http://cran.rstudio.com/')"32RUN R -e "install.packages('BiocManager', repos='http://cran.rstudio.com/')"33RUN R -e "BiocManager::install(c('BSgenome', 'BSgenome.Hsapiens.UCSC.hg19', 'GenomeInfoDb'), ask=FALSE, update=FALSE)"34 35# Install deconstructSigs from GitHub (Bioconductor version removed)36RUN R -e "remotes::install_github('raerose01/deconstructSigs', dependencies=TRUE)"37 38 39# Copy the rest of your application40COPY . /app41RUN chmod -R 777 /app/others_prediction_explanation/42 43 44# Set the working directory45WORKDIR /app46EXPOSE 786047 48# The command to run your application49# Adjust this command based on how you run your app (e.g., Flask, Gradio app)50CMD ["python", "app.py"]