Spaces:
No application file
No application file
# Use the Miniconda3 image as a base | |
FROM continuumio/miniconda3 | |
LABEL org.opencontainers.image.source=https://github.com/suchanek/proteusPy | |
LABEL org.opencontainers.image.description="RCSB Disulfide Viewer" | |
LABEL org.opencontainers.image.licenses=BSD-3-Clause | |
# Set environment variables to prevent interactive prompts during package installations | |
ENV DEBIAN_FRONTEND=noninteractive \ | |
PATH="/opt/conda/envs/proteusPy/bin:$PATH" \ | |
PYVISTA_OFF_SCREEN=true \ | |
DOCKER_RUNNING=true \ | |
MPLCONFIGDIR=/tmp/matplotlib \ | |
PDB=/home/appuser | |
# Install system dependencies | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends \ | |
libgl1-mesa-glx \ | |
mesa-utils \ | |
libegl1-mesa \ | |
xvfb \ | |
xauth \ | |
libxrender1 \ | |
libxext6 && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN useradd -m -u 1000 appuser | |
# Copy the environment.yml file for better caching | |
COPY environment.yml /tmp/environment.yml | |
# Create the conda environment | |
RUN conda env create -f /tmp/environment.yml && \ | |
/opt/conda/envs/proteusPy/bin/pip install --verbose proteusPy --upgrade && \ | |
conda clean --all --yes && \ | |
rm -rf /opt/conda/pkgs/* | |
# Set the working directory in the container | |
WORKDIR /app | |
# Copy the current directory contents into the container at /app | |
COPY --chown=appuser . /app | |
# Fix permissions and prepare Matplotlib cache | |
RUN mkdir -p /tmp/matplotlib && \ | |
chown -R appuser:appuser /tmp/matplotlib && \ | |
chown -R appuser:appuser /app && \ | |
chmod +x /app/entrypoint.sh | |
# Update the login bash profile to activate the environment with interactive access. | |
RUN echo "source activate proteusPy" >> ~/.bashrc | |
# Switch to the non-root user | |
USER appuser | |
# Expose port 7860 for the Bokeh server | |
EXPOSE 7860 | |
# Set the entrypoint to the entrypoint script | |
ENTRYPOINT ["/app/entrypoint.sh"] | |
CMD ["panel", "serve", "--port", "7860", "--allow-websocket-origin=*", "/app/app.py"] | |