sudo-paras-shah commited on
Commit
866ac02
·
1 Parent(s): 5ac59c8

Fix anaconda issue in docker

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -5
Dockerfile CHANGED
@@ -12,12 +12,16 @@ RUN apt-get update && apt-get install -y \
12
  COPY requirements.txt ./
13
  COPY src/ ./src/
14
 
15
- RUN conda create -n appenv python=3.12 -y && \
16
- echo "conda activate appenv" >> ~/.bashrc && \
17
- /bin/bash -c "source ~/.bashrc && conda activate appenv && conda install --file requirements.txt && pip install scikit-learn"
 
18
 
 
19
  EXPOSE 8501
20
 
21
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
22
 
23
- ENTRYPOINT ["/bin/bash", "-c", "source activate appenv && streamlit run src/streamlit_app.py --server.port=8501 --server.address=0.0.0.0"]
 
 
12
  COPY requirements.txt ./
13
  COPY src/ ./src/
14
 
15
+ # Create environment and install dependencies
16
+ RUN conda create -n appenv python=3.12 -y
17
+ RUN conda run -n appenv conda install --file requirements.txt -y
18
+ RUN conda run -n appenv pip install scikit-learn streamlit
19
 
20
+ # Expose Streamlit port
21
  EXPOSE 8501
22
 
23
+ # Healthcheck
24
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
25
 
26
+ # Set entrypoint using conda run
27
+ ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "appenv", "streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]