Skip to content

feat: add Docker Compose support for Linux - #275

Open
matheusAFONSECA wants to merge 1 commit into
vietanhdev:mainfrom
matheusAFONSECA:feat/docker-compose-support
Open

matheusAFONSECA wants to merge 1 commit into
vietanhdev:mainfrom
matheusAFONSECA:feat/docker-compose-support

Conversation

@matheusAFONSECA

Copy link
Copy Markdown

Summary

Add Docker Compose support for running AnyLabeling locally on Linux without installing Python, PyQt6, or inference dependencies on the host.

After configuring .env and the dataset directory once, users can launch the desktop application with:

docker compose up --build

Changes

  • Add a Python 3.12 image that installs the local repository with its existing CPU dependencies.
  • Configure X11 access through read-only socket and Xauthority mounts.
  • Run the application as a non-root user with configurable host UID/GID.
  • Mount host datasets at /data and persist application settings, model storage, and caches in a named volume.
  • Use Docker layers and a BuildKit pip cache to speed up rebuilds.
  • Add .dockerignore, .env_example, a README reference, and documentation covering setup, image folders, annotation persistence, and troubleshooting.

Changes are limited to container configuration and documentation.

Contribution to development

This provides a consistent local environment for contributors and reduces setup problems caused by differences in host Python and Qt installations.

Contributors can build and test their checkout through the same Compose workflow. CPU defaults make the environment usable without NVIDIA hardware, while dataset mounts keep images and annotation outputs directly accessible to host tools.

Persistent application state also allows containers to be recreated without losing settings or model storage.

Validation

Validation performed during implementation:

  • Docker Compose configuration and image builds passed.
  • The desktop application launched through X11.
  • The existing unit suite passed: 142 tests, 16 skipped.
  • Programmatic GUI checks opened images, saved JSON annotations, and exported YOLO labels.
  • Generated files retained the configured host UID/GID.
  • Annotations, application settings, Qt settings, and model configuration files persisted across container recreation.

Limitations

The setup targets local Linux desktops using X11 or XWayland. Native Wayland-only sessions and rootless Docker/user namespace remapping are outside the documented configuration.

Related to #209.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant