Skip to content

Commit

Permalink
Changed the base image to laxzal/laxzal:latest so this reduces the co…
Browse files Browse the repository at this point in the history
…de required for maintaining
  • Loading branch information
calvinp0 committed Feb 12, 2024
1 parent dc0c592 commit 4c1903d
Showing 1 changed file with 11 additions and 38 deletions.
49 changes: 11 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,12 @@
# Using the a base image of rmgpy:latest from DockerHub - Not the official version but a custom version that is smaller in size
FROM --platform=linux/amd64 laxzal/rmgpy:latest
FROM --platform=linux/amd64 laxzal/arc:latest

USER rmguser

# Installing ARC
# Change directory to Code
WORKDIR /home/rmguser/Code

# Clone main branch ARC repository from GitHub and set as working directory
RUN git clone -b main https://github.com/ReactionMechanismGenerator/ARC.git
WORKDIR /home/rmguser/Code/ARC

# Set environment variables for the Docker run and container
ENV PYTHONPATH="${PYTHONPATH}:/home/rmguser/Code/ARC"
ENV PYTHONPATH="${PYTHONPATH}:/home/rmguser/Code/AutoTST"
ENV PYTHONPATH="${PYTHONPATH}:/home/rmguser/Code/TS-GCN"
ENV PATH /home/rmguser/Code/ARC:$PATH

# Install ARC Environment
RUN micromamba create -y -f environment.yml && \
micromamba clean --all -f -y && \
rm -rf /home/rmguser/.cache/yarn \
rm -rf /home/rmguser/.cache/pip &&\
rm -rf /home/rmguser/.cache/pip && \
find -name '*.a' -delete && \
find -name '*.pyc' -delete && \
find -name '__pycache__' -type d -exec rm -rf '{}' '+' && \
find /opt/conda/envs/arc_env/lib/python3.7/site-packages/scipy -name 'tests' -type d -exec rm -rf '{}' '+' && \
find /opt/conda/envs/arc_env/lib/python3.7/site-packages/numpy -name 'tests' -type d -exec rm -rf '{}' '+' && \
find /opt/conda/envs/arc_env/lib/python3.7/site-packages/pandas -name 'tests' -type d -exec rm -rf '{}' '+' && \
find /opt/conda/envs/arc_env/lib/python3.7/site-packages -name '*.pyx' -delete && \
rm -rf /opt/conda/envs/arc_env/lib/python3.7/site-packages/uvloop/loop.c &&\
make clean

# Install T3

# Change directory to Code
Expand All @@ -54,21 +28,20 @@ RUN micromamba create -y -f environment.yml && \
find /opt/conda/envs/t3_env/lib/python3.7/site-packages -name '*.pyx' -delete \
&& find /opt/conda/ -follow -type f -name '*.a' -delete \
&& find /opt/conda/ -follow -type f -name '*.pyc' -delete \
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete

# Add alias to bashrc - rmge to activate the environment
# These commands are not necessary for the Docker image to run, but they are useful for the user
RUN echo "alias arce='micromamba activate arc_env'" >> ~/.bashrc \
&& echo "export PYTHONPATH=/home/rmguser/Code/ARC:$PYTHONPATH" >> ~/.bashrc \
&& echo "export PYTHONPATH=\"${PYTHONPATH}:/home/rmguser/Code/AutoTST\"" >> ~/.bashrc \
&& echo "alias arc='python /home/rmguser/Code/ARC/ARC.py input.yml'" >> ~/.bashrc \
&& echo "export PYTHONPATH=\"${PYTHONPATH}:/home/rmguser/Code/TS-GCN\"" >> ~/.bashrc \
&& echo "alias deact='micromamba deactivate'" >> ~/.bashrc \
&& echo "export arc_path='/home/rmguser/Code/ARC/'" >> ~/.bashrc \
RUN echo "export arc_path='/home/rmguser/Code/ARC/'" >> ~/.bashrc \
&& echo "export t3_path='/home/rmguser/Code/T3/'" >> ~/.bashrc \
&& echo "alias arccode='cd \$arc_path'" >> ~/.bashrc \
&& echo "alias t3code='cd \$t3_path'" >> ~/.bashrc \
&& echo "alias t3e='micromamba activate t3_env'" >> ~/.bashrc \
&& echo "alias t3='python /home/rmguser/Code/T3/T3.py input.yml'" >> ~/.bashrc
&& echo "alias t3='python /home/rmguser/Code/T3/T3.py input.yml'" >> ~/.bashrc

# Set the wrapper script as the entrypoint
ENTRYPOINT ["/home/rmguser/entrywrapper.sh"]

SHELL ["/bin/bash", "-c"]
# Activate the T3 environment
WORKDIR /home/rmguser/
ARG MAMBA_DOCKERFILE_ACTIVATE=1
ENV ENV_NAME=t3_env

0 comments on commit 4c1903d

Please sign in to comment.