Commit ·
866ac02
1
Parent(s): 5ac59c8
Fix anaconda issue in docker
Browse files- 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 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 18 |
|
|
|
|
| 19 |
EXPOSE 8501
|
| 20 |
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
| 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"]
|