搭建cvat/server 時(shí), 需要將多個(gè)鏡像公用的volume綁定在本地路徑下, 可在docker-compose.yml 中編輯volume屬性:
# Copyright (C) 2018-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
services:
cvat_db:
container_name: cvat_db
image: postgres:15-alpine
restart: always
environment:
POSTGRES_USER: root
POSTGRES_DB: cvat
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- cvat_db:/var/lib/postgresql/data
networks:
- cvat
cvat_redis:
container_name: cvat_redis
image: redis:4.0-alpine
restart: always
networks:
- cvat
cvat_server:
container_name: cvat_server
image: cvat/server:${CVAT_VERSION:-dev}
restart: always
depends_on:
- cvat_redis
- cvat_db
- cvat_opa
environment:
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: 1
DJANGO_LOG_SERVER_HOST: vector
DJANGO_LOG_SERVER_PORT: 80
CLICKHOUSE_HOST: clickhouse
CVAT_ANALYTICS: 1
CVAT_BASE_URL:
command: -c supervisord/server.conf
labels:
- traefik.enable=true
- traefik.http.services.cvat.loadbalancer.server.port=8080
- traefik.http.routers.cvat.rule=PathPrefix(`/api/`, `/git/`, `/opencv/`, `/static/`, `/admin`, `/documentation/`, `/django-rq`)
- traefik.http.routers.cvat.entrypoints=web
volumes:
- cvat_data:/home/django/data
- cvat_keys:/home/django/keys
- cvat_logs:/home/django/logs
- ./data:/home/django/tmp
networks:
cvat:
aliases:
- cvat-server
# .... 省略其他的鏡像參數(shù)
volumes:
cvat_db:
cvat_data: # 設(shè)置volume cvat_data 綁定至本機(jī) /data/cvat/data
driver_opts:
type: none
o: bind
device: /data/cvat/data
cvat_keys: # 設(shè)置volume cvat_keys 綁定至本機(jī) /data/cvat/keys
driver_opts:
type: none
o: bind
device: /data/cvat/keys
cvat_logs: # 設(shè)置volume cvat_logs 綁定至本機(jī) /data/cvat/logs
driver_opts:
type: none
o: bind
device: /data/cvat/logs
cvat_events_db:
networks:
cvat: