Skip to content

Commit d701e1e

Browse files
authored
Merge pull request #134 from OpenMS/fix_dockerfile_simple
Fix Dockerfile Simple
2 parents b50a587 + 346c934 commit d701e1e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Dockerfile_simple

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ RUN wget -q \
4545
&& rm -f Miniforge3-Linux-x86_64.sh
4646
RUN mamba --version
4747

48-
# Activate and configure the mamba environment
49-
RUN mamba update -n base -c conda-forge mamba && mamba info && mamba create -n streamlit-env python=3.10
50-
# note: activation of mamba needs to go to bashrc because every RUN command spawns new bash
48+
# Setup mamba environment.
49+
COPY environment.yml ./environment.yml
50+
RUN mamba env create -f environment.yml
51+
RUN echo "mamba activate streamlit-env" >> ~/.bashrc
52+
SHELL ["/bin/bash", "--rcfile", "~/.bashrc"]
5153
SHELL ["mamba", "run", "-n", "streamlit-env", "/bin/bash", "-c"]
52-
RUN echo "source activate streamlit-env" > ~/.bashrc
5354

5455
#################################### install streamlit
5556
# install packages
@@ -84,8 +85,9 @@ RUN echo "0 3 * * * /root/miniforge3/envs/streamlit-env/bin/python /app/clean-up
8485

8586
# create entrypoint script to start cron service and launch streamlit app
8687
RUN echo "#!/bin/bash" > /app/entrypoint.sh
87-
RUN echo "service cron start" >> /app/entrypoint.sh
88-
RUN echo "mamba run --no-capture-output -n streamlit-env streamlit run app.py" >> /app/entrypoint.sh
88+
RUN echo "source /root/miniforge3/bin/activate streamlit-env" >> /app/entrypoint.sh && \
89+
echo "service cron start" >> /app/entrypoint.sh && \
90+
echo "streamlit run app.py" >> /app/entrypoint.sh
8991
# make the script executable
9092
RUN chmod +x /app/entrypoint.sh
9193

0 commit comments

Comments
 (0)