Skip to content

Commit

Permalink
Fix compatibility with older versions of Docker Compose (#7170)
Browse files Browse the repository at this point in the history
<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->
In 6ae1cff, I accidentally left behind the empty `command:` key. This
works, but only with Docker Compose v2.17.1+. Since we don't actually
need this key, we might as well remove it and restore compatibility with
older versions.

Also, rearrange the commented out code so that you only need to
uncomment one block to enable the Traefik dashboard.

Fixes #7153.

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->
Manual testing.

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- [x] I have created a changelog fragment <!-- see top comment in
CHANGELOG.md -->
- ~~[ ] I have updated the documentation accordingly~~
- ~~[ ] I have added tests to cover my changes~~
- [x] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))
- ~~[ ] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))~~

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.
  • Loading branch information
SpecLad authored Dec 14, 2023
1 parent cbd5f43 commit d7bbc10
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Restored Compose file compatibility with Docker Compose 2.17.0 and earlier
(<https://github.com/opencv/cvat/pull/7170>)
18 changes: 8 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,6 @@ services:
image: traefik:v2.10
container_name: traefik
restart: always
command:
# labels:
# - traefik.enable=true
# - traefik.http.routers.dashboard.entrypoints=dashboard
# - traefik.http.routers.dashboard.service=api@internal
# - traefik.http.routers.dashboard.rule=Host(`${CVAT_HOST:-localhost}`)
ports:
- 8080:8080
- 8090:8090
Expand All @@ -248,10 +242,14 @@ services:
TRAEFIK_PROVIDERS_DOCKER_EXPOSEDBYDEFAULT: "false"
TRAEFIK_PROVIDERS_DOCKER_NETWORK: cvat
TRAEFIK_PROVIDERS_FILE_DIRECTORY: /etc/traefik/rules

# Uncomment to get Traefik dashboard
# TRAEFIK_API_DASHBOARD: "true"
# TRAEFIK_ENTRYPOINTS_dashboard_ADDRESS: :8090
# Uncomment to get Traefik dashboard
# TRAEFIK_API_DASHBOARD: "true"
# TRAEFIK_ENTRYPOINTS_dashboard_ADDRESS: :8090
# labels:
# - traefik.enable=true
# - traefik.http.routers.dashboard.entrypoints=dashboard
# - traefik.http.routers.dashboard.service=api@internal
# - traefik.http.routers.dashboard.rule=Host(`${CVAT_HOST:-localhost}`)
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./components/analytics/grafana_conf.yml:/etc/traefik/rules/grafana_conf.yml:ro
Expand Down

0 comments on commit d7bbc10

Please sign in to comment.