From 05cf34032f44c61b1ef204ad65bb1ac9a783222c Mon Sep 17 00:00:00 2001 From: Florez Ospina Juan Felipe Date: Wed, 12 Mar 2025 16:15:49 +0100 Subject: [PATCH] WIP: Add dockerignore and Dockerfile. I have built the Docker image and seems to be working fine but haven't tested all aspects of the applicaton --- .dockerignore | 8 ++++++++ Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5e8b390 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +data/ +figures/ +pipelines/params/ +envs/ +logs/ +*.pyc +__pycache__/ +*.h5 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e9e2a1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# Get additional info about the Dockerfile at https://docs.docker.com/reference/dockerfile/ + +FROM continuumio/miniconda3:latest + +# Define the name of the environment +ARG ENV_NAME=apog_penv +ENV ENV_NAME=apog_penv + +# Set the working directory +WORKDIR /acsmdc + +# Use mamba if available for faster installation +RUN conda install -y -n base -c conda-forge mamba && \ + mamba create -y -n $ENV_NAME -c conda-forge -c defaults python=3.11 \ + jupyter numpy h5py pandas matplotlib plotly=5.24 scipy pip && \ + conda clean --all -y && rm -rf /root/.cache/pip + +# Activate the environment and install additional pip packages +RUN conda run -n $ENV_NAME pip install pybis==1.35 igor2 ipykernel sphinx dash dash-bootstrap-components + +# Set the default environment when the container starts +ENV CONDA_DEFAULT_ENV=$ENV_NAME +ENV PATH=/opt/conda/envs/$ENV_NAME/bin:$PATH + +# Create necessary directories for VOLUME +RUN mkdir -p /acsmdc/data /acsmdc/figures /acsmdc/pipelines/params + +# Copy project files, excluding certain directories (handled via .dockerignore) +COPY . / + +# Define volumes for excluded directories +VOLUME ["/acsmdc/data", "/acsmdc/figures", "/acsmdc/pipelines/params"] + +# Default command: Run Conda shell so Python and Conda are accessible +CMD ["/bin/bash"]