Sifal commited on
Commit
10f7f28
·
verified ·
1 Parent(s): 5cd3e53

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -13
Dockerfile CHANGED
@@ -1,20 +1,17 @@
1
- # Start from the Miniconda3 base image
2
- FROM continuumio/miniconda3:4.12.0
3
 
4
- # Set the Python version you want
5
- ENV PYTHON_VERSION=3.10.15
6
 
7
- # Set up the working directory
8
- WORKDIR /code
9
- COPY ./environment.yml /code/environment.yml
10
 
11
- # Create the environment using the environment.yml file
12
- RUN conda install python=$PYTHON_VERSION -y && \
13
- conda env create -f /code/environment.yml && \
14
- conda clean --all --yes
15
 
16
- # Activate the environment
17
- ENV PATH="/opt/conda/envs/$(head -n 1 /code/environment.yml | cut -d ' ' -f 2)/bin:$PATH"
18
 
19
  # Set up a new user named "user" with user ID 1000
20
  RUN useradd -m -u 1000 user
 
1
+ FROM continuumio/miniconda3:latest
 
2
 
3
+ # Copy the environment YAML file into the container
4
+ COPY environment.yml /app/environment.yml
5
 
6
+ # Install dependencies from the YAML file
7
+ RUN conda env create -f /app/environment.yml && conda clean -afy
 
8
 
9
+ # Activate the environment by default
10
+ SHELL ["/bin/bash", "-c"]
11
+ RUN echo "conda activate cloudspace" >> ~/.bashrc
 
12
 
13
+ # Set the default shell to use the environment
14
+ ENV PATH /opt/conda/envs/cloudspace/bin:$PATH
15
 
16
  # Set up a new user named "user" with user ID 1000
17
  RUN useradd -m -u 1000 user