-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support running CVAT with an external database via Docker Compose
With Docker Compose, you can initialize a secret from an environment variable, but you can't load a secret _into_ an environment variable. So in order to be able to read the DB password from a secret, I had to introduce a new `CVAT_DB_PASSWORD_FILE` variable.
- Loading branch information
Showing
5 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
changelog.d/20231024_190737_roman_docker_compose_external_db.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### Added | ||
|
||
- Support for using an external database in a Docker Compose-based deployment | ||
(<https://github.com/opencv/cvat/pull/7055>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (C) 2023 CVAT.ai Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
# This optional Docker Compose file may be used to deploy CVAT with an external database. | ||
|
||
x-backend-settings: &backend-settings | ||
environment: | ||
CVAT_POSTGRES_HOST: | ||
CVAT_POSTGRES_PORT: | ||
CVAT_POSTGRES_DBNAME: | ||
CVAT_POSTGRES_USER: | ||
CVAT_POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password | ||
secrets: | ||
- postgres_password | ||
|
||
services: | ||
cvat_db: | ||
deploy: | ||
replicas: 0 | ||
|
||
cvat_server: *backend-settings | ||
cvat_utils: *backend-settings | ||
cvat_worker_analytics_reports: *backend-settings | ||
cvat_worker_annotation: *backend-settings | ||
cvat_worker_export: *backend-settings | ||
cvat_worker_import: *backend-settings | ||
cvat_worker_quality_reports: *backend-settings | ||
cvat_worker_webhooks: *backend-settings | ||
|
||
secrets: | ||
postgres_password: | ||
environment: CVAT_POSTGRES_PASSWORD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters