diff --git a/docker-build.sh b/docker-build.sh index cdffdb8bc..c3ca55795 100644 --- a/docker-build.sh +++ b/docker-build.sh @@ -17,7 +17,7 @@ else exit 1 fi -# Step 2: Start the container without mounting the venv volume +# Step 2: Start the container without mounting the volumes (venv, custom_nodes) echo "Starting the container..." COMPOSE_BAKE=true docker-compose up -d if [ $? -eq 0 ]; then @@ -36,14 +36,14 @@ LOGS_PID=$! # Save the PID of the background process # Wait for the container logs to indicate it's ready (looking for the custom message) echo "Waiting for the container to be fully started..." while ! docker logs "$container_name" 2>&1 | grep -q "To see the GUI go to: http://0.0.0.0:8188"; do - sleep 20 + sleep 10 done # Stop streaming logs (kill the background process) kill $LOGS_PID echo "Container is fully started." -# Step 4: Copy the 'venv' directory from the container to the host +# Step 4.1: Copy the 'venv' directory from the container to the host echo "Checking if /app/venv exists in the container..." if docker exec "$container_name" ls /app/venv; then echo "Copying the virtual environment from the container to the host..." @@ -58,7 +58,7 @@ else exit 1 fi -# Step 4: Copy the 'ComfyUI-Manager' directory from the container to the host +# Step 4.2: Copy the 'ComfyUI-Manager' directory from the container to the host echo "Checking if /app/comfyui/custom_nodes/ComfyUI-Manager exists in the container..." if docker exec "$container_name" ls /app/comfyui/custom_nodes/ComfyUI-Manager; then echo "Copying the ComfyUI-Manager from the container to the host..." @@ -83,7 +83,7 @@ else exit 1 fi -# Step 6: Update the Docker Compose file to mount the venv volume +# Step 6.1: Update the Docker Compose file to mount the venv volume echo "Updating Docker Compose file to mount the virtual environment..." sed -i '/# Mount the venv directory for persistence/a \ \ \ \ \ \ - ./venv:/app/venv' docker-compose.yml if [ $? -eq 0 ]; then @@ -93,7 +93,7 @@ else exit 1 fi -# Step 6: Update the Docker Compose file to mount the venv volume +# Step 6.2: Update the Docker Compose file to mount the venv volume echo "Updating Docker Compose file to mount the custom_nodes..." sed -i '/# Mount the custom nodes directory directly inside/a \ \ \ \ \ \ - ./custom_nodes:/app/comfyui/custom_nodes' docker-compose.yml if [ $? -eq 0 ]; then @@ -103,4 +103,6 @@ else exit 1 fi -echo "Setup complete! you can use "docker-compose up" to start the container." \ No newline at end of file +echo "======================================== SETUP COMPLETE ========================================" +echo "use 'docker-compose up' to start the container and 'docker-compose down' to stop the container." +echo "================================================================================================" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 34b9b7159..fe46b96a0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,15 +8,15 @@ services: ports: - "8188:8188" # Expose the backend API or server volumes: - - ./input:/app/comfyui/input # Mount the input directory directly inside /app/comfyui - - ./models:/app/comfyui/models # Mount the models directory directly inside /app/comfyui - - ./output:/app/comfyui/output # Mount the output directory directly inside /app/comfyui - - ./user:/app/comfyui/user # Comment this line and uncomment the next line if you want to have a workflows directory in the root directory. - #- ./workflows:/app/comfyui/user/default/workflows + - ./input:/app/comfyui/input # Volume for input files + - ./models:/app/comfyui/models # Volume for models + - ./output:/app/comfyui/output # Volume for output files + - ./user:/app/comfyui/user # Volume for user settings, Also this is where your workflows are stored + #- ./workflows:/app/comfyui/user/default/workflows # Uncomment if you to make a workflow directory in the comfyui directory - # Mount the venv directory for persistence (automatically mounted with you run docker-build.sh) + # Mount the venv directory for persistence (automatically mounted with you run docker-build.sh) #Don't change this - # Mount the custom nodes directory directly inside /app/comfyui (automatically mounted with you run docker-build.sh) + # Mount the custom nodes directory directly inside /app/comfyui (automatically mounted with you run docker-build.sh) #Don't change this environment: