pradyML commited on
Commit
b05ebdc
·
1 Parent(s): 81cb589

adapted Dockerfile and yaml file for Mamba

Browse files
Files changed (2) hide show
  1. Dockerfile +9 -9
  2. environment.yml +2 -2
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
- # Use a Conda-enabled base image
2
- FROM continuumio/miniconda3:latest
3
 
4
  # Set the working directory in the container
5
  WORKDIR /app
@@ -7,14 +7,15 @@ WORKDIR /app
7
  # Copy the environment.yml file into the container
8
  COPY environment.yml .
9
 
10
- # Create the Conda environment from environment.yml
11
- # --name research-agent-gpu : Use the name defined in your environment.yml
12
- # -f environment.yml : Use the copied file
13
- # Conda cleans up its cache to reduce image size
14
- RUN conda env create -f environment.yml && conda clean --all
15
 
16
  # Activate the Conda environment and set it as the default for subsequent commands
17
- ENV PATH=/opt/conda/envs/research-agent-gpu/bin:$PATH
 
18
 
19
  # Copy the rest of your application code
20
  COPY . .
@@ -23,5 +24,4 @@ COPY . .
23
  EXPOSE 7860
24
 
25
  # Command to run your application when the container starts
26
- # Make sure app.py is in the root of your /app directory inside the container
27
  CMD ["python", "app.py"]
 
1
+ # Use a Mambaforge base image for faster and more memory-efficient solving
2
+ FROM condaforge/mambaforge:latest
3
 
4
  # Set the working directory in the container
5
  WORKDIR /app
 
7
  # Copy the environment.yml file into the container
8
  COPY environment.yml .
9
 
10
+ # Create the Conda environment using mamba and clean up
11
+ # mamba env create is the equivalent of conda env create but faster and less memory intensive
12
+ # The --yes flag answers yes to prompts
13
+ # mamba clean --all clears caches
14
+ RUN mamba env create --yes -f environment.yml && mamba clean --all
15
 
16
  # Activate the Conda environment and set it as the default for subsequent commands
17
+ # Ensure the environment name matches what's in your environment.yml
18
+ ENV PATH /opt/conda/envs/research-agent-gpu/bin:$PATH
19
 
20
  # Copy the rest of your application code
21
  COPY . .
 
24
  EXPOSE 7860
25
 
26
  # Command to run your application when the container starts
 
27
  CMD ["python", "app.py"]
environment.yml CHANGED
@@ -6,8 +6,8 @@
6
 
7
  name: research-agent-gpu
8
  channels:
9
- - pytorch
10
- - nvidia
11
  - conda-forge
12
  - defaults
13
  dependencies:
 
6
 
7
  name: research-agent-gpu
8
  channels:
9
+ # - pytorch
10
+ # - nvidia
11
  - conda-forge
12
  - defaults
13
  dependencies: