diff --git a/.dockerignore b/.dockerignore index 9bb4397a..dbf267bd 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,21 @@ **/__pycache__ **/*.py[cod] +.pytest_cache/ +.mypy_cache/ +.ruff_cache/ +.cache/ +.coverage +.hypothesis/ +.benchmarks/ +*.log +*.tgz +*.tar.gz +*.zip +dist/ +build/ +pip-wheel-metadata/ +*.egg-info/ +node_modules/ .env .git/ .venv/ diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 4172e977..73f0b97f 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -90,6 +90,7 @@ RUN conda run -n comfystream --cwd /workspace/comfystream --no-capture-output pi COPY ./workflows/comfyui/* /workspace/ComfyUI/user/default/workflows/ COPY ./test/example-512x512.png /workspace/ComfyUI/input COPY ./docker/entrypoint.sh /workspace/comfystream/docker/entrypoint.sh +RUN chmod +x /workspace/comfystream/docker/entrypoint.sh # Install ComfyUI requirements RUN conda run -n comfystream --no-capture-output --cwd /workspace/ComfyUI pip install -r requirements.txt --constraint /workspace/comfystream/src/comfystream/scripts/constraints.txt --root-user-action=ignore @@ -118,7 +119,7 @@ RUN echo "conda activate comfystream" >> ~/.bashrc WORKDIR /workspace/comfystream -# Run ComfyStream BYOC server from /workspace/ComfyUI within the comfystream conda env -ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "comfystream", "--cwd", "/workspace/ComfyUI", "python", "/workspace/comfystream/server/byoc.py"] -# Default args; can be overridden/appended at runtime +# Run ComfyStream BYOC server by default but allow overriding the command +ENTRYPOINT ["/workspace/comfystream/docker/entrypoint.sh"] +# Default args; can be overridden/appended at runtime or replaced entirely CMD ["--workspace", "/workspace/ComfyUI", "--host", "0.0.0.0", "--port", "8000"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index e6d44463..9d44d9d2 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -222,6 +222,15 @@ if [ "$START_COMFYUI" = true ] || [ "$START_API" = true ] || [ "$START_UI" = tru # Keep the script running tail -f /var/log/supervisord.log + exit 0 +fi + +# Activate conda environment +conda activate comfystream + +# If no args or first arg is an option, run the BYOC server with default args. +if [[ $# -eq 0 || "$1" == -* ]]; then + set -- python /workspace/comfystream/server/byoc.py "$@" fi exec "$@"