diff --git a/images/assets/pulp-api b/images/assets/pulp-api index 655d4ea5..199fd8db 100755 --- a/images/assets/pulp-api +++ b/images/assets/pulp-api @@ -1,18 +1,4 @@ #!/bin/bash -x - -mkdir -p /var/lib/pulp/media \ - /var/lib/pulp/assets \ - /var/lib/pulp/tmp - -/usr/bin/wait_on_postgres.py - -# Get list of installed plugins via pip -# Assumes they are all named like "pulp-file" -> "file", with no 2nd dash. -# (Was previously needed when we ran `pulpcore-manager makemigrations`) -# PLUGINS=$(pip list | awk -F '[[:space:]]+|[-]' '/pulp-/{printf $2 " " }') - -/usr/local/bin/pulpcore-manager migrate --noinput - set +x if [ -n "${PULP_SIGNING_KEY_FINGERPRINT}" ]; then diff --git a/images/assets/pulp-content b/images/assets/pulp-content index 12550287..fa817c65 100755 --- a/images/assets/pulp-content +++ b/images/assets/pulp-content @@ -1,8 +1,5 @@ #!/bin/bash -x -/usr/bin/wait_on_postgres.py -/usr/bin/wait_on_database_migrations.sh - if which pulpcore-content then PULP_CONTENT_ENTRYPOINT=("pulpcore-content") diff --git a/images/assets/pulp-worker b/images/assets/pulp-worker index f63e33b2..90ccb7dd 100755 --- a/images/assets/pulp-worker +++ b/images/assets/pulp-worker @@ -1,7 +1,4 @@ #!/bin/bash -x -/usr/bin/wait_on_postgres.py -/usr/bin/wait_on_database_migrations.sh - export PATH=/usr/local/bin:/usr/bin/ exec pulpcore-worker diff --git a/images/compose/compose.yml b/images/compose/compose.yml index 6eace6d6..5ae32681 100644 --- a/images/compose/compose.yml +++ b/images/compose/compose.yml @@ -20,6 +20,18 @@ services: timeout: 5s retries: 5 + migration_service: + image: "pulp/pulp-minimal:latest" + depends_on: + postgres: + condition: service_healthy + restart: never + command: ['pulpcore-manager', 'migrate', '--noinput'] + volumes: + - "./assets/settings.py:/etc/pulp/settings.py:z" + - "./assets/certs:/etc/pulp/certs:z" + - "pulp:/var/lib/pulp" + redis: image: "docker.io/library/redis:latest" volumes: @@ -56,6 +68,8 @@ services: condition: service_healthy postgres: condition: service_healthy + migration_service: + condition: service_completed_successfully hostname: pulp-api user: pulp volumes: @@ -81,6 +95,8 @@ services: condition: service_healthy postgres: condition: service_healthy + migration_service: + condition: service_completed_successfully hostname: pulp-content user: pulp volumes: @@ -104,6 +120,8 @@ services: condition: service_healthy postgres: condition: service_healthy + migration_service: + condition: service_completed_successfully user: pulp volumes: - "./assets/settings.py:/etc/pulp/settings.py:z"