Skip to content

Commit

Permalink
Improve Docker image build and do build image in pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Cassaert <[email protected]>
  • Loading branch information
tcassaert committed Sep 24, 2024
1 parent a2dbedb commit 98045d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
28 changes: 5 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
FROM python:3.9-slim-bullseye


# Workaround for IPv4/IPv6 networking performance issues.
# (https://stackoverflow.com/questions/65760510/readtimeouterror-pip-not-installling-any-library)
RUN echo "precedence ::ffff:0:0/96 100" >> /etc/gai.conf
FROM python:3.11-slim-bookworm


# Install OS updates (https://pythonspeed.com/articles/docker-cache-insecure-images/)
Expand Down Expand Up @@ -34,23 +29,10 @@ USER openeo
ENV VIRTUAL_ENV="/home/openeo/venv"
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip install --upgrade pip

# Install openeo-aggregator
COPY --chown=openeo requirements.txt .
RUN pip install -r requirements.txt

# Copy source code
RUN mkdir /home/openeo/aggregator
WORKDIR /home/openeo/aggregator
COPY --chown=openeo setup.py setup.py
COPY --chown=openeo src src
COPY --chown=openeo conf conf
COPY --chown=openeo pytest.ini pytest.ini
COPY --chown=openeo tests tests
COPY --chown=openeo CHANGELOG.md CHANGELOG.md


# Install dependencies and app.
RUN pip install --upgrade pip && \
pip install .


# TODO #117/#143 eliminate conf/gunicorn.prod.py reference
CMD ["gunicorn", "--config=conf/gunicorn.prod.py", "openeo_aggregator.app:create_app()"]
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@Library('lib')_

pythonPipeline {
build_container_image = true
package_name = 'openeo-aggregator'
test_module_name = 'openeo_aggregator'
wipeout_workspace = true
Expand Down

0 comments on commit 98045d0

Please sign in to comment.