Skip to content

Commit 37330fb

Browse files
authored
Update Dockerfile
1 parent c423954 commit 37330fb

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Dockerfile

+12-7
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ RUN apt-get update && \
1515
apt-get clean && \
1616
rm -rf /var/lib/apt/lists/*
1717

18-
# Create conda environment
18+
# Create conda environment and install jupyterlab
1919
RUN conda env create -f /tmp/environment.yml && \
20+
conda install -n uwgda-image-living -c conda-forge jupyterlab && \
2021
conda clean -afy
2122

22-
# Add jupyterlab to environment
23-
RUN conda install -n uwgda-image-living -c conda-forge jupyterlab && \
24-
conda clean -afy
23+
# Make RUN commands use the new conda environment
24+
SHELL ["conda", "run", "-n", "uwgda-image-living", "/bin/bash", "-c"]
25+
26+
# Set up conda env activation
27+
RUN echo "conda activate uwgda-image-living" >> ~/.bashrc
2528

26-
# Add conda environment to PATH
27-
ENV PATH /opt/conda/envs/uw-gda-living/bin:$PATH
29+
# Add conda environment to PATH and set CONDA_DEFAULT_ENV
30+
ENV PATH /opt/conda/envs/uwgda-image-living/bin:$PATH
31+
ENV CONDA_DEFAULT_ENV uwgda-image-living
2832

2933
# Set up work directory and permissions
3034
WORKDIR /home/jovyan
@@ -36,5 +40,6 @@ USER jovyan
3640
# Expose Jupyter port
3741
EXPOSE 8888
3842

39-
# Start JupyterLab
43+
# Start JupyterLab using conda run to ensure we're in the right environment
44+
ENTRYPOINT ["conda", "run", "-n", "uwgda-image-living"]
4045
CMD ["jupyter", "lab", "--ip", "0.0.0.0", "--no-browser", "--ServerApp.token=''"]

0 commit comments

Comments
 (0)