Sifal commited on
Commit
5cd3e53
·
verified ·
1 Parent(s): 4b5d4c3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -11
Dockerfile CHANGED
@@ -1,21 +1,20 @@
 
1
  FROM continuumio/miniconda3:4.12.0
2
 
3
- # Set working directory
 
 
 
4
  WORKDIR /code
5
  COPY ./environment.yml /code/environment.yml
6
 
7
- # Update Miniconda and install Python 3.10.15
8
- RUN conda update -n base -c defaults conda -y && \
9
- conda create -n myenv python=3.10.15 -y && \
10
- conda clean --all --yes
11
-
12
- # Activate the environment and install dependencies
13
- RUN echo "conda activate myenv" >> ~/.bashrc && \
14
- conda run -n myenv conda env update -f /code/environment.yml && \
15
  conda clean --all --yes
16
 
17
- # Set the PATH to include the new environment
18
- ENV PATH /opt/conda/envs/myenv/bin:$PATH
19
 
20
  # Set up a new user named "user" with user ID 1000
21
  RUN useradd -m -u 1000 user
 
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