Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/issue 7 create working docker image #23

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
gcc \
libnetcdf-dev \
libhdf5-dev \
hdf5-helpers \
#libhdf5-dev \
#hdf5-helpers \
&& pip3 install --upgrade pip \
&& pip3 install cython \
&& apt-get clean
&& apt-get clean \
&& pip3 install poetry

# Create a new user
RUN adduser --quiet --disabled-password --shell /bin/sh --home /home/dockeruser --gecos "" --uid 1000 dockeruser
Expand All @@ -27,13 +28,23 @@ ARG DIST_PATH

USER root
RUN mkdir -p /worker && chown dockeruser /worker
COPY ../pyproject.toml /worker
USER dockeruser

WORKDIR /worker

ENV PYTHONPATH=${PYTHONPATH}:${PWD}

COPY --chown=dockeruser $DIST_PATH $DIST_PATH
USER dockeruser
RUN pip3 install --no-cache-dir --force --user --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ $SOURCE \
&& rm -rf $DIST_PATH
#RUN pip3 install --no-cache-dir --force --user --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ $SOURCE \
# && rm -rf $DIST_PATH

#install poetry as root
USER root
RUN poetry config virtualenvs.create false
RUN poetry install --no-dev

USER dockeruser
# Run the Batchee Harmony service
ENTRYPOINT ["batchee_harmony"]