Skip to content

Commit

Permalink
deployment: fix docker image creation
Browse files Browse the repository at this point in the history
* Updated docker base image.
* Adds a second test scenario with latest dependencies versions.
* Fixes dependencies with last versions.
* Copies static files for productions.
* Adds --ci option for the bootstrap script.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
  • Loading branch information
jma committed Nov 16, 2022
1 parent 4edfc2c commit 59ccc1f
Show file tree
Hide file tree
Showing 6 changed files with 516 additions and 239 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/continuous-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ env:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
dependencies: ['dev', 'deploy']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Libraries
run: |
Expand All @@ -22,9 +25,9 @@ jobs:
sudo sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read" pattern="PDF" \/>/g' /etc/ImageMagick-6/policy.xml
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '12'
node-version: '14'

- name: Docker compose up
run: docker-compose up -d
Expand All @@ -42,6 +45,17 @@ jobs:
poetry run ./scripts/bootstrap
pip install --upgrade coveralls
- name: Bootstrap
if: ${{ matrix.dependencies == 'dev' }}
run: |
poetry run ./scripts/bootstrap --ci
pip install --upgrade coveralls
- name: Bootstrap deploy
if: ${{ matrix.dependencies == 'deploy' }}
run: |
poetry run ./scripts/bootstrap --ci --deploy E2E=yes
- name: Run Test
run: poetry run ./scripts/test

Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
ARG VERSION=latest
FROM sonar-base:${VERSION}

USER 0

# Copy files
COPY ./ ${WORKING_DIR}/src
WORKDIR ${WORKING_DIR}/src
Expand All @@ -35,9 +37,12 @@ COPY ./docker/uwsgi/ ${INVENIO_INSTANCE_PATH}
# Change owner
RUN chown -R invenio:invenio ${WORKING_DIR}

USER 1000

# Run bootstrap
ENV TERM=xterm-256color
ARG UI_TGZ=""
ENV INVENIO_COLLECT_STORAGE='flask_collect.storage.file'
RUN poetry run ./scripts/bootstrap --deploy --ui ${UI_TGZ}

ENTRYPOINT [ "bash", "-c"]
8 changes: 2 additions & 6 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# and includes Pip, Pipenv, Node.js, NPM and some few standard libraries
# Invenio usually needs.

FROM python:3.9-slim-buster
FROM python:3.9-slim-bullseye

# require debian packages
RUN apt-get upgrade -y && apt-get update -y
Expand Down Expand Up @@ -56,8 +56,4 @@ RUN useradd invenio --uid ${INVENIO_USER_ID} --home ${WORKING_DIR} && \
chown -R invenio:invenio ${WORKING_DIR} && \
chmod -R go+w ${WORKING_DIR}

# Install dependencies
RUN poetry run pip install --upgrade pip "setuptools<58"
RUN poetry install --no-dev


USER 1000

0 comments on commit 59ccc1f

Please sign in to comment.