Skip to content

Commit

Permalink
Factor out shared environment variables in docker-compose.yml (#7016)
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. -->
This improves maintainability of the file.

### 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. -->
I brought CVAT up using Docker Compose, and checked that the environment
variables in containers were as expected.

### 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
- ~~[ ] 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~~
- ~~[ ] 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 Oct 23, 2023
1 parent f8f2052 commit e038b7c
Showing 1 changed file with 17 additions and 47 deletions.
64 changes: 17 additions & 47 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
#
# SPDX-License-Identifier: MIT

x-backend-env: &backend-env
CLICKHOUSE_HOST: clickhouse
CVAT_POSTGRES_HOST: cvat_db
CVAT_REDIS_HOST: cvat_redis
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
no_proxy: clickhouse,grafana,vector,nuclio,opa,${no_proxy:-}
SMOKESCREEN_OPTS: ${SMOKESCREEN_OPTS:-}

services:
cvat_db:
container_name: cvat_db
Expand Down Expand Up @@ -41,20 +50,14 @@ services:
- cvat_db
- cvat_opa
environment:
<<: *backend-env
DJANGO_MODWSGI_EXTRA_ARGS: ''
ALLOWED_HOSTS: '*'
CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db'
ADAPTIVE_AUTO_ANNOTATION: 'false'
IAM_OPA_BUNDLE: '1'
no_proxy: clickhouse,grafana,vector,nuclio,opa,${no_proxy:-}
NUMPROCS: 2
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
CLICKHOUSE_HOST: clickhouse
CVAT_ANALYTICS: 1
CVAT_BASE_URL:
SMOKESCREEN_OPTS: ${SMOKESCREEN_OPTS:-}
command: init run server
labels:
- traefik.enable=true
Expand All @@ -80,13 +83,8 @@ services:
- cvat_db
- cvat_opa
environment:
CVAT_REDIS_HOST: 'cvat_redis'
<<: *backend-env
CVAT_REDIS_PASSWORD: ''
CVAT_POSTGRES_HOST: 'cvat_db'
CLICKHOUSE_HOST: clickhouse
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
no_proxy: clickhouse,grafana,vector,nuclio,opa,${no_proxy:-}
NUMPROCS: 1
command: run utils
volumes:
Expand All @@ -104,13 +102,8 @@ services:
- cvat_redis
- cvat_db
environment:
CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db'
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
no_proxy: clickhouse,grafana,vector,nuclio,opa,${no_proxy:-}
<<: *backend-env
NUMPROCS: 2
SMOKESCREEN_OPTS: ${SMOKESCREEN_OPTS:-}
command: run worker.import
volumes:
- cvat_data:/home/django/data
Expand All @@ -127,12 +120,7 @@ services:
- cvat_redis
- cvat_db
environment:
CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db'
CLICKHOUSE_HOST: clickhouse
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
no_proxy: clickhouse,grafana,vector,nuclio,opa,${no_proxy:-}
<<: *backend-env
NUMPROCS: 2
command: run worker.export
volumes:
Expand All @@ -151,11 +139,7 @@ services:
- cvat_db
- cvat_opa
environment:
CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db'
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
no_proxy: clickhouse,grafana,vector,nuclio,opa,${no_proxy:-}
<<: *backend-env
NUMPROCS: 1
command: run worker.annotation
volumes:
Expand All @@ -174,13 +158,8 @@ services:
- cvat_db
- cvat_opa
environment:
CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db'
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
no_proxy: clickhouse,grafana,vector,nuclio,opa,${no_proxy:-}
<<: *backend-env
NUMPROCS: 1
SMOKESCREEN_OPTS: ${SMOKESCREEN_OPTS:-}
command: run worker.webhooks
volumes:
- cvat_data:/home/django/data
Expand All @@ -197,11 +176,7 @@ services:
- cvat_redis
- cvat_db
environment:
CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db'
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
no_proxy: clickhouse,grafana,vector,nuclio,opa,${no_proxy:-}
<<: *backend-env
NUMPROCS: 1
command: run worker.quality_reports
volumes:
Expand All @@ -219,12 +194,7 @@ services:
- cvat_redis
- cvat_db
environment:
CVAT_REDIS_HOST: 'cvat_redis'
CVAT_POSTGRES_HOST: 'cvat_db'
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
CLICKHOUSE_HOST: clickhouse
no_proxy: clickhouse,grafana,vector,nuclio,opa,${no_proxy:-}
<<: *backend-env
NUMPROCS: 2
command: run worker.analytics_reports
volumes:
Expand Down

0 comments on commit e038b7c

Please sign in to comment.