FROM continuumio/miniconda3:latest
# Build-time: cache environment creation by adding the env YAML first
# Ensure non-interaction during package installs
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /workspace
# Copy environment spec and create the Conda environment
COPY environment.yml /tmp/environment.yml
RUN conda update -n base -c defaults conda && \
conda env create -f /tmp/environment.yml --prefix /opt/conda/envs/machine-learning-book && \
conda clean -afy
# Add the newly created environment to PATH for ease of use
ENV PATH=/opt/conda/envs/machine-learning-book/bin:$PATH
# Copy the rest of the repository
COPY . /workspace
# Expose JupyterLab port so users can run notebooks from the container
EXPOSE 8888
# Default command: start JupyterLab
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
__pycache__/ *.pyc *.pyo *.pyd *.pyo .ipynb_checkpoints/ .env/ .env.* .env*.* .env/ **/__pycache__/ **/*.pyc **/*.pyo node_modules/ build/ dist/ temp/ *.ipynb *.ipynb_checkpoints .DS_Store .idea/ .vscode/ .git/ .envrc .envs/ *.egg-info/ "
Concerns: FROM image uses 'latest' tag which may cause non-deterministic builds; pin to a specific version., No HEALTHCHECK defined to monitor container readiness., Potentially large base image due to Miniconda; consider slimming or using a lighter base if possible. Smoke [PASS]: python -V Smoke [PASS]: jupyter --version