diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 025de54..124bcec 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -100,6 +100,8 @@ services: env_file: .env volumes: - ./:/app + - model_cache_dev:/root/.cache + - u2net_models_dev:/root/.u2net depends_on: redis: condition: service_healthy @@ -138,3 +140,5 @@ networks: volumes: mysql_data_dev: redis_data_dev: + model_cache_dev: + u2net_models_dev: diff --git a/docker-compose.yml b/docker-compose.yml index 2bba8b7..76953c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -104,6 +104,11 @@ services: - ./app/static:/app/app/static - ./app/uploads:/app/app/uploads - ./logs:/app/logs + # The worker downloads its models on first import and on first job. Without + # these the caches live in the container layer, so every deploy recreates the + # container, wipes them and leaves uploads queued until the models are back. + - model_cache:/root/.cache + - u2net_models:/root/.u2net depends_on: redis: condition: service_healthy @@ -144,3 +149,5 @@ networks: volumes: mysql_data: redis_data: + model_cache: + u2net_models: