diff --git a/Dockerfile b/Dockerfile index 20d4b5d..537fb0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ ARG GITSHA ARG GITDATE # set and echo environment variables -ENV BUILD_TIME $BUILD_TIME -ENV BRANCH $BRANCH +ENV BUILD_TIME=$BUILD_TIME +ENV BRANCH=$BRANCH ENV GITVERSION=${GITVERSION} ENV GITSHA=${GITSHA} ENV GITDATE=${GITDATE} @@ -21,30 +21,47 @@ RUN echo "GITVERSION: "$GITVERSION RUN echo "GITSHA: "$GITSHA RUN echo "GITDATE: "$GITDATE -# Install capcalc +# copy capcalc into container COPY . /src/capcalc RUN echo $GITVERSION > /src/capcalc/VERSION + +# init and install picachooser +RUN uv pip install --upgrade pip RUN cd /src/capcalc && \ - pip install . && \ - rm -rf /src/capcalc/build /src/capcalc/dist + uv pip install . +RUN chmod -R a+r /src/capcalc + +# install versioneer +RUN cd /src/picachooser && \ + versioneer install --no-vendor && \ + rm -rf /src/picachooser/build /src/picachooser/dist # clean up -#RUN mamba clean -y --all RUN pip cache purge # Create a shared $HOME directory -RUN useradd -m -s /bin/bash -G users capcalc -WORKDIR /home/capcalc -ENV HOME="/home/capcalc" +ENV USER=capcalc +RUN useradd \ + --create-home \ + --shell /bin/bash \ + --groups users \ + --home /home/$USER \ + $USER +RUN cp ~/.bashrc /home/$USER/.bashrc; chown $USER /home/$USER/.bashrc + +WORKDIR /home/$USER +ENV HOME="/home/$USER" ENV IN_DOCKER_CONTAINER=1 RUN ldconfig WORKDIR /tmp/ -ENTRYPOINT ["capcalc_dispatcher"] -# set a non-root user -USER capcalc +# set to non-root user and initialize mamba +USER $USER +RUN /opt/miniforge3/bin/mamba init + +ENTRYPOINT ["/opt/miniforge3/envs/science/bin/capcalc_dispatcher"] LABEL org.label-schema.build-date=$BUILD_TIME \ org.label-schema.name="capcalc" \