Spaces:
No application file
No application file
File size: 1,941 Bytes
3edd11c e004093 3edd11c ebb04f2 3edd11c | 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 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"]
|