diff --git a/auto_update.py b/auto_update.py index 1b5195d..aa686b9 100755 --- a/auto_update.py +++ b/auto_update.py @@ -252,6 +252,7 @@ def main(service_name): config = CONFIG[service_name] pull_docker_images(config["images"]) + restart_docker(service_name) try: # Start the periodic check loop @@ -259,6 +260,10 @@ def main(service_name): logger.info("Checking for updates...") current_dojo_version = get_current_version() new_dojo_version = get_latest_remote_tag() + + logger.info(f"Current version: {current_dojo_version}") + logger.info(f"Latest version: {new_dojo_version}") + has_image_updates = check_for_image_updates(config["images"]) # Check if either the version has changed or there are image updates @@ -271,7 +276,6 @@ def main(service_name): # Restart Docker if there are any updates restart_docker(service_name) - logger.info(f"Sleeping for {CHECK_INTERVAL} seconds.") time.sleep(CHECK_INTERVAL) except KeyboardInterrupt: diff --git a/docker-compose.validator.yaml b/docker-compose.validator.yaml index 4ae20f3..e6fe966 100644 --- a/docker-compose.validator.yaml +++ b/docker-compose.validator.yaml @@ -92,6 +92,8 @@ services: build: context: . dockerfile: ./docker/Dockerfile.validator.prisma + command: > + sh -c "prisma migrate deploy && prisma generate" env_file: - .env.validator working_dir: /app diff --git a/docker/Dockerfile.validator.prisma b/docker/Dockerfile.validator.prisma index 15daff8..1c94813 100644 --- a/docker/Dockerfile.validator.prisma +++ b/docker/Dockerfile.validator.prisma @@ -21,9 +21,5 @@ ENV PRISMA_BINARY_CACHE_DIR=/root/prisma-python COPY ./schema.prisma /app/schema.prisma RUN pip install prisma -RUN prisma generate RUN [ -n "$$DATABASE_URL" ] - -# Push Prisma schema to the database -CMD ["prisma", "migrate", "deploy"]