From 81d03f1b0ffdaeaf03d61ac0b8328cfed486230f Mon Sep 17 00:00:00 2001 From: silask Date: Tue, 17 Dec 2024 09:50:28 +0100 Subject: [PATCH] add docker file for testing --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ docker_run.sh | 1 + 2 files changed, 34 insertions(+) create mode 100644 Dockerfile create mode 100755 docker_run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..ae637b21 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# Start with the Miniconda base image +FROM continuumio/miniconda3:24.9.2-0 + +# Set the working directory in the container +WORKDIR /main + +# Copy the environment file and project code +COPY atlasenv.yml . + +# Create a user with a specific UID and GID +RUN groupadd -g 1000 atlasgroup && \ + useradd -m -u 1000 -g atlasgroup -s /bin/bash atlasuser + +# Set the HOME environment variable +ENV HOME=/home/atlasuser + +# Change ownership of the home directory +RUN chown -R atlasuser:atlasgroup $HOME + +# Switch to the new user +USER atlasuser + +# Create and activate the environment +RUN conda env create -n atlas -f atlasenv.yml && \ + conda clean -afy && \ + echo "source activate atlas" > ~/.bashrc + +# Set the working directory +WORKDIR /main + + +# Set the default command +CMD ["bash"] \ No newline at end of file diff --git a/docker_run.sh b/docker_run.sh new file mode 100755 index 00000000..590f2eee --- /dev/null +++ b/docker_run.sh @@ -0,0 +1 @@ +docker run -it --name atlas-debug -v $(pwd):/main atlas-debug \ No newline at end of file